Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].inor...
分类:
其他好文 时间:
2015-01-18 11:45:40
阅读次数:
173
Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].Not...
分类:
其他好文 时间:
2015-01-18 11:45:24
阅读次数:
189
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the next...
分类:
其他好文 时间:
2015-01-18 09:17:43
阅读次数:
146
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:
其他好文 时间:
2015-01-17 22:04:05
阅读次数:
178
Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree. 1 /** 2 * De....
分类:
其他好文 时间:
2015-01-17 20:47:15
阅读次数:
211
Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next level and al...
分类:
其他好文 时间:
2015-01-17 17:58:07
阅读次数:
199
Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree. 1 /** 2 * Def....
分类:
其他好文 时间:
2015-01-17 16:29:31
阅读次数:
160
Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next level and al...
分类:
其他好文 时间:
2015-01-17 13:51:25
阅读次数:
136
The problem:The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the ...
分类:
其他好文 时间:
2015-01-17 06:19:58
阅读次数:
177
iven a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For exam...
分类:
其他好文 时间:
2015-01-16 22:17:55
阅读次数:
292