题目Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which r...
分类:
其他好文 时间:
2014-07-15 23:21:33
阅读次数:
218
HHyper Prefix SetsPrefix goodness of a set string is length of longest common prefix*number of strings in the set. For example the prefix goodness of ...
分类:
其他好文 时间:
2014-07-15 08:51:08
阅读次数:
261
Two SumGiven an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the...
分类:
其他好文 时间:
2014-07-15 08:45:17
阅读次数:
236
3Sum ClosestGiven an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three int...
分类:
其他好文 时间:
2014-07-14 15:23:22
阅读次数:
171
Combination SumGiven a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thes...
分类:
其他好文 时间:
2014-07-14 10:43:07
阅读次数:
222
编程世界的两个基本元素:数据和代码。数据天生文静,欲在保持;代码天生活泼,欲在改变。面向对象的思想首次把数据和代码结合成统一体,并以一个简单的对象概念呈现给编程者。JavaScript中简单数据只有undefined、null、boolean、number和string五种,复杂数据只有object...
分类:
编程语言 时间:
2014-07-14 10:23:02
阅读次数:
261
这是练习题,没啥难度,留作纪念,记录下来 1 #include 2 using namespace std; 3 int main() 4 { 5 int number; 6 7 for (int i = 0; ; i++) 8 { 9 if (i%3 =...
分类:
其他好文 时间:
2014-07-13 22:40:44
阅读次数:
296
The + operator concatenates lists: Similarly, the * operator repeats a list a given number of items:List slicesThe slice operator also works...
分类:
其他好文 时间:
2014-07-13 19:42:02
阅读次数:
208
这里记录下堆的相关操作。
op 1:
'''
@ data: the heap array
@ p : index of parent item
@ n : number of data
@@ Swap p and it's son items, make p the largest of them
'''
def swapForMaxHeap(data, n, p):
l...
分类:
其他好文 时间:
2014-07-13 17:07:15
阅读次数:
223
对于每一个文件的 file.id and file.incarnation number,重命名文件别名...
分类:
其他好文 时间:
2014-07-13 15:28:26
阅读次数:
233