复习一下KMP算法 KMP的主要思想是利用字符串自身的前缀后缀的对称性,来构建next数组,从而实现用接近O(N)的时间复杂度完成字符串的匹配 对于一个字符串str,next[j] = k 表示满足str[0...k-1] = str[j-k...j-1]的最大的k,即对于子串str[0...j-1 ...
分类:
其他好文 时间:
2016-12-03 20:52:47
阅读次数:
154
Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the ...
分类:
其他好文 时间:
2016-12-03 14:50:13
阅读次数:
153
题目: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 没事来做 ...
分类:
编程语言 时间:
2016-12-02 03:00:40
阅读次数:
210
He bent over and began scraping together a pile of the white mush. 他弯下腰,开始团起一个白色的雪球。 "I'll see you at lunch, okay?" I kept walking as I spoke. "Once p ...
分类:
其他好文 时间:
2016-11-28 22:54:58
阅读次数:
235
问题: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 官方难度 ...
分类:
其他好文 时间:
2016-11-28 15:31:08
阅读次数:
347
Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may a ...
分类:
其他好文 时间:
2016-11-27 09:58:57
阅读次数:
356
Given an absolute path for a file (Unix-style), simplify it. For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c" click to show co ...
分类:
其他好文 时间:
2016-11-27 09:50:11
阅读次数:
254
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Solution ...
分类:
其他好文 时间:
2016-11-23 07:48:52
阅读次数:
168
Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may a ...
分类:
其他好文 时间:
2016-11-22 01:38:06
阅读次数:
225
#21. Merge Two Sorted Lists Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of t ...
分类:
其他好文 时间:
2016-11-20 19:06:37
阅读次数:
295