1 class Solution { 2 public: 3 /** 4 * @param dictionary: a vector of strings 5 * @return: a vector of strings 6 */ 7 vector l...
分类:
其他好文 时间:
2015-06-30 01:25:36
阅读次数:
857
1 class Solution { 2 public: 3 /** 4 * @param string: An array of Char 5 * @param length: The true length of the string 6 * @retur...
分类:
其他好文 时间:
2015-06-30 01:17:38
阅读次数:
130
暴力解法(O(n^2)): 1 class Solution { 2 public: 3 /** 4 * Returns a index to the first occurrence of target in source, 5 * or -1 if target i...
分类:
其他好文 时间:
2015-06-30 00:02:52
阅读次数:
176
1 class Solution { 2 public: 3 /** 4 * @param A: sorted integer array A which has m elements, 5 * but size of A is m+n 6 ...
分类:
编程语言 时间:
2015-06-29 23:48:23
阅读次数:
346
The recursive solution is trivial and I omit it here.Iterative Solution using Stack (O(n)time andO(n)space): 1 /** 2 * Definition of TreeNode: 3 * c.....
分类:
其他好文 时间:
2015-06-29 19:52:58
阅读次数:
121
The recursive solution is trivial and I omit it here.Iterative Solution using Stack (O(n)time andO(n)space): 1 /** 2 * Definition of TreeNode: 3 * c.....
分类:
其他好文 时间:
2015-06-29 19:33:05
阅读次数:
102
A subroutine of merge sort. 1 class Solution { 2 public: 3 /** 4 * @param A and B: sorted integer array A and B. 5 * @return: A new sort...
分类:
编程语言 时间:
2015-06-29 19:23:28
阅读次数:
403
1 class Solution { 2 public: 3 /** 4 * @param strs: A list of strings 5 * @return: The longest common prefix 6 */ 7 string...
分类:
其他好文 时间:
2015-06-29 16:36:19
阅读次数:
197
The recursive solution is trivial and I omit it here.Iterative Solution using Stack (O(n) time and O(n) space): 1 /** 2 * Definition of TreeNode: 3 .....
分类:
其他好文 时间:
2015-06-29 16:17:05
阅读次数:
106
Find the Weak Connected Component in the Directed GraphFind the number Weak Connected Component in the directed graph. Each node in the graph contains...
分类:
其他好文 时间:
2015-06-29 14:33:09
阅读次数:
125