上一页 1 2 3 4 5 6 ··· 23 下一页
摘要: 这个很好玩啊,有个博客讲得非常好: http://www.cnblogs.com/skywang12345/p/3577479.html 基本上要点都在里面。 我觉得最核心的一点就是对树的四种操作。 (图中k的交标代表了在图中的大小顺序,1最小。比如图中有三个节点k1,k2,k3,关系就是k1<k2 阅读全文
posted @ 2016-10-31 07:43 warmland 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 把核心的逻辑都放在Node里面 所以Node的代码是: Map部分的代码是: 阅读全文
posted @ 2016-10-31 07:10 warmland 阅读(317) 评论(0) 推荐(0) 编辑
摘要: A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but i 阅读全文
posted @ 2016-10-28 05:06 warmland 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Design a simplified version of Twitter where users can post tweets, follow/unfollow another user and is able to see the 10 most recent tweets in the u 阅读全文
posted @ 2016-10-26 08:28 warmland 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 非常不要脸地做一个easy,是fb面经= =……那个人人品也是可以 和remove duplicates from sorted array道理是一样的,用i对整个数组走一遍,然后用index保持有效的位置。最后把index及之后的都填成0就可以了 阅读全文
posted @ 2016-10-26 06:47 warmland 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 感觉需要注意的点就是在A-Z和a-z之间还夹了6个其他的字符,所以统计的时候不能用new int[52]需要new int[58] 代码; 阅读全文
posted @ 2016-10-25 13:23 warmland 阅读(249) 评论(0) 推荐(0) 编辑
摘要: BitInteger的最简单的部分 把两个string反过来,从后往前加,可以学习的地方是对于while的条件可以设置成,index1< len1 || index2 < len2. 然后在内部分别对index1 < len1和index2 <len2处理,这样就不用对其中一个提前结束的情况单独再写 阅读全文
posted @ 2016-10-25 13:01 warmland 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 原题链接: https://leetcode.com/problems/longest-absolute-file-path/ Suppose we abstract our file system by a string in the following manner: The string "d 阅读全文
posted @ 2016-10-25 12:44 warmland 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 之前做过的g家面经。 就是比起存原矩阵,把矩阵转换成每行储存该行到此位置的和 比如原来的一行是,1,2,3,4,那么现在的矩阵就是1,3,6,10。 于是每次update需要把从第row行col列开始到这行结束的位置都更新,是O(n) 每次sumRegion是每行col2-col1的差的和,也是O( 阅读全文
posted @ 2016-10-25 11:13 warmland 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 和merge k sorted linked list是一样的,不同就是自己要打一个包建一个类,然后建一个pq 时间复杂度是O(klogn). n = matrix.length 阅读全文
posted @ 2016-10-24 08:31 warmland 阅读(124) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 23 下一页