Serialize and Deserialize Binary TreeSerialization is the process of converting a data structure or object into a sequence of bits so that it can be s...
分类:
其他好文 时间:
2015-10-29 19:48:10
阅读次数:
252
描述A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, ...
分类:
其他好文 时间:
2015-10-29 06:08:14
阅读次数:
151
Given a binary tree, find the maximum path sum.For this problem, a path is defined as any sequence of nodes from some starting node to any node in the...
分类:
其他好文 时间:
2015-10-28 21:05:06
阅读次数:
186
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 e...
分类:
其他好文 时间:
2015-10-28 20:59:33
阅读次数:
231
A simple application to binary tree traversal.class Solution { typedef pair Rec; // last val - length unsigned ret; void go(TreeNode *p, Rec ...
分类:
其他好文 时间:
2015-10-28 12:09:31
阅读次数:
140
create sequence seqrole start with 4create or replace trigger truserrolsinsertbefore inserton userrolesfor each rowbegin if inserting then se...
分类:
其他好文 时间:
2015-10-27 17:35:28
阅读次数:
129
The Run Loop Sequence of Events Each time you run it, your thread’s run loop processes pending events and generates notifications for any attached observers. The order in which it does this is ve...
分类:
其他好文 时间:
2015-10-27 15:32:51
阅读次数:
198
Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or ...
分类:
其他好文 时间:
2015-10-27 15:02:55
阅读次数:
218
Number Sequence思路基本思路:穷举每一个值,直到f(n),但是这样会遇到Time Limit Exceeded找规律:自己动手计算了一些值后发现值按一定周期循环,那么只要找到周期就可以大量减少计算时间。只要找到某两个值f(i-1), f(i)与前面的某两个值f(j-1), f(j),使...
分类:
其他好文 时间:
2015-10-25 12:12:06
阅读次数:
209
求s1是否是s2的子串。分析:例如sequence 和 subsequence 。从头开始比较,s1[0]与s2[0]相同,那么它们下标都可+1,接着比较s1[1]和s2[1],不相同;这时应该保证s1[1]不动,而把s2下标+1.直到s1,s2下标移动到最后一位,若s1下标移动到了最后一位,显然判...
分类:
其他好文 时间:
2015-10-24 20:13:53
阅读次数:
250