一、 题目
题目给出一个字符串,求出它是否为回文字符串,其中只有字母和数字是有效字符,其他的字符可以忽略。
例如:"Aman, a plan, a canal: Panama" 是回文字符串.
"race a car" is not a palindrome.不是回文字符串
二、 分析
看到这个题目我首先想到的是使用两个数组将有效字符串保存,其中一个正序一个逆序,然后做比...
分类:
其他好文 时间:
2014-12-26 21:44:07
阅读次数:
152
很久之前刷的CTCI的题目,都快忘记了,做个分类汇总,再重新好好复习一遍。
Chapter 1 | Arrays and Strings
1.1 Implement an algorithm to determine if a string has all unique characters. What if you can not use additional
data stru...
分类:
其他好文 时间:
2014-12-26 20:20:00
阅读次数:
452
dumpheap 时提示:0:105> !dumpheap -stat The garbage collector data structures are not in a valid state for traversal. It is either in the "plan phase...
分类:
数据库 时间:
2014-12-26 20:14:45
阅读次数:
398
Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For example, the ...
分类:
其他好文 时间:
2014-12-26 20:14:20
阅读次数:
156
SSMS在一定程度上方便我们进行一些常见的操作。但有时候它处理得又不是那么不人性化。尤其是错误信息。今天我在进行数据库还原的时候就碰到一个错误:指定的转换无效。(SqlManagerUI)Specified cast is not valid.(SqlManagerUI)没办法,不得不敲代码了:RE...
分类:
数据库 时间:
2014-12-26 14:30:02
阅读次数:
1382
Evaluate the value of an arithmetic expression in Reverse Polish Notation.
Valid operators are +, -, *, /.
Each operand may be an integer or another expression.
Some examples:
["2", "1", ...
分类:
其他好文 时间:
2014-12-26 13:08:49
阅读次数:
168
在C语言里面一直很容易混淆的,gets和fgetS的区别:char * fgets ( char * str, int num, FILE * stream );Reads characters fromstreamand stores them as a C string intostruntil...
分类:
编程语言 时间:
2014-12-26 09:34:49
阅读次数:
221
找到最多含有两个不同字符的子串的最长长度。例如:eoeabc,最长的是eoe为3,其他都为2.思路:用p1,p2表示两种字符串的最后一个出现的下标位置。初始p1为0. p2为-1.start初始化为0,表示两种字符串的开头。只要遍历一次string就可以得到结果了。首先我们要确定p2的值,那么i要一...
分类:
其他好文 时间:
2014-12-25 21:47:44
阅读次数:
150
【1】_BLOCK_TYPE_IS_VALID是什么错误?(1)最简单的示例代码如下:1 void main()2 {3 int* pA = new int(1);4 delete pA;5 delete pA;6 }(2)运行后崩溃截图如下:(3)分析结果:这个assert...
分类:
其他好文 时间:
2014-12-25 20:13:21
阅读次数:
206
Given a string containing just the characters '(', ')',
'{', '}', '[' and ']', determine if the input string is valid.
The brackets must close in the correct order, "()" and "()[]{}" are all valid b...
分类:
其他好文 时间:
2014-12-25 16:25:57
阅读次数:
123