摘要: 1 public class BinarySearchSolution 2 { 3 public int BinarySearch(int[] array, int target) 4 { 5 int low = 0, high = array.Length; ... 阅读全文
posted @ 2017-12-28 14:32 逸朵 阅读(142) 评论(0) 推荐(0)
摘要: Given a string, find the length of the longest substring T that contains at most k distinct characters. For example, Given s = “eceba” and k = 2, T is 阅读全文
posted @ 2017-12-28 13:37 逸朵 阅读(131) 评论(0) 推荐(0)
摘要: Note:A subtree must include all of its descendants.Here's an example: The Largest BST Subtree in this case is the highlighted one. The return value is 阅读全文
posted @ 2017-12-28 09:55 逸朵 阅读(151) 评论(0) 推荐(0)
摘要: Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn't one, return 0 instead. Note:The sum of 阅读全文
posted @ 2017-12-28 05:17 逸朵 阅读(461) 评论(0) 推荐(0)
摘要: Write a function to generate the generalized abbreviations of a word. Example: Given word = "word", return the following list (order does not matter): 阅读全文
posted @ 2017-12-28 04:30 逸朵 阅读(376) 评论(0) 推荐(0)
摘要: Given a binary tree, return the vertical order traversal of its nodes' values. (ie, from top to bottom, column by column). If two nodes are in the sam 阅读全文
posted @ 2017-12-28 01:46 逸朵 阅读(304) 评论(0) 推荐(0)