上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 54 下一页
摘要: Given an unsorted integer array, find the first missing positive integer. Example Given [1,2,0] return 3,and [3,4,-1,1] return 2. 分析: 我们只需要把1到A.length 阅读全文
posted @ 2016-07-09 12:24 北叶青藤 阅读(210) 评论(0) 推荐(0)
摘要: Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. Given a st 阅读全文
posted @ 2016-07-09 09:23 北叶青藤 阅读(201) 评论(0) 推荐(0)
摘要: Implement a stack with min() function, which will return the smallest number in the stack. It should support push, pop and min operation all in O(1) c 阅读全文
posted @ 2016-07-09 07:59 北叶青藤 阅读(188) 评论(0) 推荐(0)
摘要: There is a fence with n posts, each post can be painted with one of the k colors.You have to paint all the posts such that no more than two adjacent f 阅读全文
posted @ 2016-07-09 06:41 北叶青藤 阅读(296) 评论(0) 推荐(0)
摘要: There are a row of n houses, each house can be painted with one of the k colors. The cost of painting each house with a certain color is different. Yo 阅读全文
posted @ 2016-07-09 03:53 北叶青藤 阅读(283) 评论(0) 推荐(0)
摘要: For a Maximum Segment Tree, which each node has an extra value max to store the maximum value in this node's interval. Implement a modify function wit 阅读全文
posted @ 2016-07-09 02:19 北叶青藤 阅读(178) 评论(0) 推荐(0)
摘要: Segment Tree Query I For an integer array (index from 0 to n-1, where n is the size of this array), in the corresponding SegmentTree, each node stores 阅读全文
posted @ 2016-07-09 00:37 北叶青藤 阅读(272) 评论(0) 推荐(0)
摘要: Segment Tree Build I The structure of Segment Tree is a binary tree which each node has two attributes start and end denote an segment / interval. sta 阅读全文
posted @ 2016-07-09 00:15 北叶青藤 阅读(154) 评论(0) 推荐(0)
摘要: Given n, how many structurally unique BSTs (binary search trees) that store values 1...n? Given n, how many structurally unique BSTs (binary search tr 阅读全文
posted @ 2016-07-08 23:11 北叶青藤 阅读(183) 评论(0) 推荐(0)
摘要: Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l 阅读全文
posted @ 2016-07-08 11:30 北叶青藤 阅读(153) 评论(0) 推荐(0)
上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 54 下一页