题目Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the o...
分类:
其他好文 时间:
2014-08-31 22:39:31
阅读次数:
324
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.
For example, given
s = "leetcode",
dict = ["leet"...
分类:
其他好文 时间:
2014-08-31 20:07:12
阅读次数:
233
题外话:才连续写了几篇博客,博客排名竟然就不再是“千里之外”了,已经进入2万名之内了。再接再厉,加油!
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.
get(key)...
分类:
其他好文 时间:
2014-08-31 17:17:51
阅读次数:
181
Given an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a linear runtime comp...
分类:
其他好文 时间:
2014-08-31 14:27:21
阅读次数:
146
Codeforces Round #264 (Div. 2) A...
分类:
其他好文 时间:
2014-08-31 09:16:41
阅读次数:
220
Codeforces Round #264 (Div. 2) B...
分类:
其他好文 时间:
2014-08-31 09:16:31
阅读次数:
271
Codeforces Round #264 (Div. 2) C...
分类:
其他好文 时间:
2014-08-31 09:16:11
阅读次数:
269
1.STL(Standard Template Library,是用泛型技术来设计完成的实例)的概念与组成
Iterator(迭代器)
Container(容器)
Algorithm(算法)
Adaptors(配接器)
STL的六大组件分别是:
容器(Container)
算法(Algorithm)
迭代器(Iterator)...
分类:
其他好文 时间:
2014-08-30 23:08:50
阅读次数:
226
一棵树上有K个黑色节点,剩余节点都为白色,将其划分成K个子树,使得每棵树上都只有1个黑色节点,共有多少种划分方案。
个人感觉这题比较难。假设dp(i,0..1)代表的是以i为根节点的子树种有0..1个黑色节点的划分方案数。
当节点i为白色时,对于它的每个孩子的节点处理:
求dp(i, 0)时有:
1,将该节点与孩子节点相连,但要保证孩子节点...
分类:
移动开发 时间:
2014-08-30 12:43:49
阅读次数:
265