上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 18 下一页

2017年5月31日

摘要: class Solution { /** * @param A: sorted integer array A which has m elements, * but size of A is m+n * @param B: sorted integer array B which has n elements * @retu... 阅读全文
posted @ 2017-05-31 09:15 codingEskimo 阅读(89) 评论(0) 推荐(0)
摘要: class Solution { /** * @param A and B: sorted integer array A and B. * @return: A new sorted integer array */ public int[] mergeSortedArray(int[] A, int[] B) { // Write... 阅读全文
posted @ 2017-05-31 09:07 codingEskimo 阅读(107) 评论(0) 推荐(0)
摘要: Note:a balaced tree needs to be balaced all the time. So it is important remember the status of each subtree. If it is not balaced in the middle, the 阅读全文
posted @ 2017-05-31 09:00 codingEskimo 阅读(88) 评论(0) 推荐(0)
摘要: /** * Definition of TreeNode: * public class TreeNode { * public int val; * public TreeNode left, right; * public TreeNode(int val) { * this.val = val; * this.left ... 阅读全文
posted @ 2017-05-31 08:32 codingEskimo 阅读(77) 评论(0) 推荐(0)
摘要: /** * Definition of TreeNode: * public class TreeNode { * public int val; * public TreeNode left, right; * public TreeNode(int val) { * this.val = val; * this.left ... 阅读全文
posted @ 2017-05-31 07:20 codingEskimo 阅读(94) 评论(0) 推荐(0)
摘要: This question is a little bit harder than the Max Depth. We only compare the depth of the leaf node. If it is missing one side, this level shouldn't b 阅读全文
posted @ 2017-05-31 06:13 codingEskimo 阅读(74) 评论(0) 推荐(0)
摘要: public class Solution { /** * @param A an integer array * @return void */ public void sortIntegers2(int[] A) { // Write your code here if (A == null || A.length... 阅读全文
posted @ 2017-05-31 05:37 codingEskimo 阅读(90) 评论(0) 推荐(0)

2017年5月28日

摘要: O(n) worst, O(nlogn) average. Use quickSort This is quickSort 阅读全文
posted @ 2017-05-28 06:26 codingEskimo 阅读(161) 评论(0) 推荐(0)
摘要: Note: 约等于O(nlogn) 阅读全文
posted @ 2017-05-28 05:47 codingEskimo 阅读(130) 评论(0) 推荐(0)
摘要: Note: 审题: 注意也有一种情况是: 一共有N个元素,要k个,但有不需要从每一个块去取, 只需要从其中的一些取。所以这里end开始应该取最大的element。而且有可能完全取不到,所以start应该从0开始取。剩下的和copy book那道题想法一致。 阅读全文
posted @ 2017-05-28 04:46 codingEskimo 阅读(179) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 18 下一页

导航