上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 22 下一页
摘要: 想清楚了,安排好细节不难public class Solution { public ArrayList> generate(int numRows) { ArrayList> res = new ArrayList>(); if(numRows tmp = new... 阅读全文
posted @ 2015-04-18 05:07 世界到处都是小星星 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 跟另一道题一样,不多说了public class Solution { public TreeNode buildTree(int[] inorder, int[] postorder) { // post就是pre的近似倒过来 if(inorder==null||... 阅读全文
posted @ 2015-04-18 03:39 世界到处都是小星星 阅读(121) 评论(0) 推荐(0) 编辑
摘要: refhttp://www.cnblogs.com/springfor/p/3884034.html以下解释摘抄自 爱做饭的小莹子“题目:Given preorder and inorder traversal of a tree, construct the binary tree.Note:Yo... 阅读全文
posted @ 2015-04-18 01:23 世界到处都是小星星 阅读(155) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public void merge(int A[], int m, int B[], int n) { if(B==null||A==null) return; int ia=m-1,ib=n-1, len = A.l... 阅读全文
posted @ 2015-04-17 13:44 世界到处都是小星星 阅读(101) 评论(0) 推荐(0) 编辑
摘要: ref // http://www.cnblogs.com/springfor/p/3869492.html // http://blog.csdn.net/linhuanmars/article/details/24444491//https://leetcode.com/probl... 阅读全文
posted @ 2015-04-17 13:25 世界到处都是小星星 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 以下全部抄自“李二娃的博客”,地址http://www.cnblogs.com/lichen782/p/leetcode_Largest_Rectangle_in_Histogram.html说的超详细超有画面感,多谢作者的解释!==========羞羞的引用转载开始==============16... 阅读全文
posted @ 2015-04-17 11:36 世界到处都是小星星 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 跟1 差不多,就是多了个一旦相等,就挪边缘的条件, 参考http://blog.csdn.net/linhuanmars/article/details/20588511public class Solution { public boolean search(int[] A, int tar... 阅读全文
posted @ 2015-04-17 10:11 世界到处都是小星星 阅读(124) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int removeDuplicates(int[] A) { //http://needjobasap.blogspot.com/2014/01/remove-duplicates-from-sorted-array... 阅读全文
posted @ 2015-04-17 07:06 世界到处都是小星星 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 对于我来说 这种dfs之类的题目还是挺有难度的,尤其是各种条件和设计要想清楚, dfs经典题目,尤其是最后要退一步,高亮处public class Solution { public boolean exist(char[][] board, String word) { if(... 阅读全文
posted @ 2015-04-17 04:20 世界到处都是小星星 阅读(196) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public ArrayList> subsetsWithDup(int[] num) { ArrayList> res = new ArrayList>(); res.add(new ArrayList()); ... 阅读全文
posted @ 2015-04-16 12:30 世界到处都是小星星 阅读(110) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 22 下一页