https://oj.leetcode.com/problems/implement-strstr/http://fisherlei.blogspot.com/2012/12/leetcode-implement-strstr.htmlpublicclassSolution{
publicintstrStr(Stringhaystack,Stringneedle){
//遍历haystack,对每一个字符,匹配needle
if(haystack==null||needle==nu..
分类:
其他好文 时间:
2015-01-02 16:12:25
阅读次数:
149
https://oj.leetcode.com/problems/swap-nodes-in-pairs/http://fisherlei.blogspot.com/2013/01/leetcode-swap-nodes-in-pairs.html/**
*Definitionforsingly-linkedlist.
*publicclassListNode{
*intval;
*ListNodenext;
*ListNode(intx){
*val=x;
*next=null;
*}
*}
*/
publ..
分类:
其他好文 时间:
2015-01-02 16:12:21
阅读次数:
151
https://oj.leetcode.com/problems/remove-duplicates-from-sorted-array/http://fisherlei.blogspot.com/2012/12/leetcode-remove-duplicates-from-sorted.htmlpublicclassSolution{
publicintremoveDuplicates(int[]A){
if(A==null||A.length==0)
return0;//Invalidinput.
..
分类:
其他好文 时间:
2015-01-02 16:12:07
阅读次数:
118
https://oj.leetcode.com/problems/reverse-nodes-in-k-group/http://fisherlei.blogspot.com/2012/12/leetcode-reverse-nodes-in-k-group.html/**
*Definitionforsingly-linkedlist.
*publicclassListNode{
*intval;
*ListNodenext;
*ListNode(intx){
*val=x;
*next=null;
*}
..
分类:
其他好文 时间:
2015-01-02 16:12:00
阅读次数:
238
https://oj.leetcode.com/problems/merge-k-sorted-lists/http://fisherlei.blogspot.com/2012/12/leetcode-merge-k-sorted-lists.html/**
*Definitionforsingly-linkedlist.
*publicclassListNode{
*intval;
*ListNodenext;
*ListNode(intx){
*val=x;
*next=null;
*}
*}
*/
pu..
分类:
其他好文 时间:
2015-01-02 16:11:43
阅读次数:
152
https://oj.leetcode.com/problems/next-permutation/http://fisherlei.blogspot.com/2012/12/leetcode-next-permutation.htmlpublicclassSolution{
publicvoidnextPermutation(int[]num){
//SolutionB
nextPermutation_Math(num);
//SolutionA
//nextPermutation_AllPerms(..
分类:
其他好文 时间:
2015-01-02 16:11:11
阅读次数:
93
https://oj.leetcode.com/problems/remove-element/http://fisherlei.blogspot.com/2012/12/leetcode-remove-element.htmlpublicclassSolution{
publicintremoveElement(int[]A,intelem){
//Theordercanbechanged.
//Use2pointers.
//Onetoiteratethearray,
//Onetocopythelas..
分类:
其他好文 时间:
2015-01-02 16:10:11
阅读次数:
129
https://oj.leetcode.com/problems/trapping-rain-water/http://fisherlei.blogspot.com/2013/01/leetcode-trapping-rain-water.htmlpublicclassSolution{
publicinttrap(int[]A){
//对于某坐标有
//-leftmax它左边最高
//-rightmax它右边最高
//-val它本身高度
//那么它的容..
分类:
移动开发 时间:
2015-01-02 07:34:08
阅读次数:
195
https://oj.leetcode.com/problems/binary-tree-postorder-traversal/http://blog.csdn.net/ljphhj/article/details/21369053/**
*Definitionforbinarytree
*publicclassTreeNode{
*intval;
*TreeNodeleft;
*TreeNoderight;
*TreeNode(intx){val=x;}
*}
*/
publicclassSolution..
分类:
其他好文 时间:
2015-01-02 07:33:36
阅读次数:
132
https://oj.leetcode.com/problems/path-sum-ii/http://fisherlei.blogspot.com/search?q=Path+Sum+II+/**
*Definitionforbinarytree
*publicclassTreeNode{
*intval;
*TreeNodeleft;
*TreeNoderight;
*TreeNode(intx){val=x;}
*}
*/
publicclassSolution{
publicList<List&..
分类:
其他好文 时间:
2015-01-02 07:33:25
阅读次数:
151