上一页 1 2 3 4 5 6 7 8 ··· 13 下一页
摘要: Given a target integer T and an integer array A sorted in ascending order, Find the total number of occurrences of T in A. Examples A = {1, 2, 3, 4, 5 阅读全文
posted @ 2018-03-29 01:29 davidnyc 阅读(270) 评论(0) 推荐(0)
摘要: Delete the node at the given index for the given linked list. Examples [1, 2, 3], delete at 1 --> [1, 3] [1, 2, 3], delete at 4 --> [1, 2, 3] [1, 2, 3 阅读全文
posted @ 2018-03-27 12:46 davidnyc 阅读(154) 评论(0) 推荐(0)
摘要: Return the number of nodes in the linked list. Examples L = null, return 0L = 1 -> null, return 1L = 1 -> 2 -> null, return 2 阅读全文
posted @ 2018-03-27 12:29 davidnyc 阅读(178) 评论(0) 推荐(0)
摘要: Find the height of binary tree. Examples: 5 / \ 3 8 / \ \ 1 4 11 The height of above binary tree is 3. 1 public class Solution { 2 ... 阅读全文
posted @ 2018-03-27 11:23 davidnyc 阅读(82) 评论(0) 推荐(0)
摘要: will do it later 阅读全文
posted @ 2018-03-27 05:10 davidnyc 阅读(194) 评论(0) 推荐(0)
摘要: DFS recursive: since this is called tail recursion, you are recommended to do it in interative: time: O(h) space: O(1) Interative: 阅读全文
posted @ 2018-03-27 05:08 davidnyc 阅读(154) 评论(0) 推荐(0)
摘要: 1 /* 2 note, here we use the concept of circle array: so head and tail could be in the middle of it. 3 head index is the 1st real value; tail index is the 1st available slot 4 h t 5 ... 阅读全文
posted @ 2018-03-26 08:47 davidnyc 阅读(225) 评论(0) 推荐(0)
摘要: 1 /* H tail 2 (last in) 1->2->3->4 (1st in) 3 o/H 4 first-out 5 6 */ 7 public class UseLinkedListImpleme... 阅读全文
posted @ 2018-03-26 08:02 davidnyc 阅读(186) 评论(0) 推荐(0)
摘要: 1 public class UseLinkedListImplementStack { 2 private ListNode head; 3 private int length ; 4 public UseLinkedListImplementStack() { 5 this.head = null ; 6 this.len... 阅读全文
posted @ 2018-03-26 07:46 davidnyc 阅读(152) 评论(0) 推荐(0)
摘要: http://www.lintcode.com/en/problem/search-range-in-binary-search-tree/ Given two values k1 and k2 (where k1 < k2) and a root pointer to a Binary Searc 阅读全文
posted @ 2018-03-26 05:52 davidnyc 阅读(261) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 13 下一页