Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree {3,...
分类:
其他好文 时间:
2014-08-17 15:32:12
阅读次数:
131
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For e...
分类:
其他好文 时间:
2014-08-17 15:31:52
阅读次数:
221
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 class Solut...
分类:
其他好文 时间:
2014-08-17 01:03:21
阅读次数:
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.分析:通过一个二叉树的先序遍历...
分类:
其他好文 时间:
2014-08-16 23:48:31
阅读次数:
333
Given a binary tree, return the inorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,3,2].
Note: Recursive solutio...
分类:
其他好文 时间:
2014-08-16 11:15:00
阅读次数:
227
历史不容假设[问题描述]Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3retu...
分类:
其他好文 时间:
2014-08-14 19:30:29
阅读次数:
191
#define NULL 0class Solution {public: vector preorderTraversal(TreeNode *root) { stack s; vector v1; if(root!=NULL) s.p...
分类:
其他好文 时间:
2014-08-14 13:35:48
阅读次数:
210
Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,2,3]...
分类:
其他好文 时间:
2014-08-11 11:53:42
阅读次数:
185