摘要:
Implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The... 阅读全文
posted @ 2015-07-19 13:37
Mad.King
阅读(162)
评论(0)
推荐(0)
摘要:
题意将一个含数字的字符串转换成int型思路实现并不困难,主要考虑各种情况。1.字符串是不是空字符串;2.字符串带空格或其他字符怎么办;3.带正负号的处理;4.字符串中的数超过int型的范围怎么办(int 范围:-2147483648~2147483647 0x80000000~0x7fffffff)... 阅读全文
posted @ 2015-07-19 13:27
Mad.King
阅读(135)
评论(0)
推荐(0)
摘要:
The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo... 阅读全文
posted @ 2015-07-19 13:12
Mad.King
阅读(184)
评论(0)
推荐(0)
摘要:
(转载)LeetCode上一道求回文字符串的问题,通常容易想到的是暴力和动态规划的方法,时间复杂度为O(n^2),后来看到有一种更巧妙的算法,Manacher’s algorithm,时间复杂度为O(n)。参考大神的博客,记下来自己的理解,方便日后查阅。1.预处理首先,由于通常情况下,对于奇数长度和... 阅读全文
posted @ 2015-07-19 12:13
Mad.King
阅读(245)
评论(0)
推荐(0)

浙公网安备 33010602011771号