Given a binary tree, print it vertically. The following example illustrates vertical order traversal. 1 / \ 2 3 / \ / \ 4 5 6 7 \ \ 8 9The output of p...
分类:
其他好文 时间:
2014-11-08 19:29:26
阅读次数:
212
题意:
Given a binary tree, return the preorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,2,3].
Note: Recursive solution is trivial, could you do it iteratively?...
分类:
其他好文 时间:
2014-11-08 13:41:21
阅读次数:
155
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:
其他好文 时间:
2014-11-08 13:35:55
阅读次数:
144
Given a binary tree, flatten it to a linked list in-place. For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened ...
分类:
其他好文 时间:
2014-11-08 13:25:14
阅读次数:
119
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum ...
分类:
其他好文 时间:
2014-11-08 13:24:56
阅读次数:
171
项目中由于需求设计,数据库中需要一个timestamp时间戳类型的字段来作为区别数据添加和修改的标识。由于timestamp在SQL SERVER 2005数据库中,不可为空的timestamp类型在语义上等同于binary(8)类型,可为空的 timestamp类型在语义上等同于varbinary...
分类:
其他好文 时间:
2014-11-08 11:55:14
阅读次数:
231
Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution stil...
分类:
其他好文 时间:
2014-11-08 11:43:47
阅读次数:
190
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree. For example:Given the below binary tree, 1 ...
分类:
其他好文 时间:
2014-11-08 08:11:54
阅读次数:
244
An encoding of a set of symbols is said to be immediately decodable if no code for one symbol is the prefix of a code for another symbol. We will assume for this problem that all codes are in binary, ...
分类:
其他好文 时间:
2014-11-08 07:05:41
阅读次数:
159
Same TreeGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally ide...
分类:
其他好文 时间:
2014-11-08 00:47:33
阅读次数:
151