Binary Tree Postorder Traversal问题:Given a binary tree, return thepostordertraversal of its nodes' values.思路: 栈方法我的代码:public class Solution { publi...
分类:
其他好文 时间:
2015-03-17 21:24:17
阅读次数:
123
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(...
分类:
其他好文 时间:
2015-03-16 22:56:26
阅读次数:
116
1 Given a binary tree, return the postorder traversal of its nodes' values. 2 3 For example: 4 Given binary tree {1,#,2,3}, 5 1 6 \ 7 2 ...
分类:
其他好文 时间:
2015-03-16 12:28:00
阅读次数:
97
Construct Binary Tree from Inorder and Postorder Traversal问题: Given inorder and postorder traversal of a tree, construct the binary tree.思路: dfs我的代码.....
分类:
其他好文 时间:
2015-03-13 22:11:25
阅读次数:
198
Given inorder and postorder traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates do not exist in the tree.
#include
#include
#include
using namespace std;
stru...
分类:
其他好文 时间:
2015-03-09 14:29:02
阅读次数:
146
1.题目Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1
2
/
3
return [3,2,1].Note: Recursive solution is trivial, co...
分类:
其他好文 时间:
2015-03-08 11:47:11
阅读次数:
136
Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to ou...
分类:
其他好文 时间:
2015-03-06 00:57:57
阅读次数:
152
二叉树二叉树的抽象数据类型的接口定义publicinterfaceBinaryTree
{
finalString[]mode={"preOrder","inOrder","postOrder","levelOrder"};
booleancreateBTree(Stringgt);
booleanisEmpty();
voidtraverseBTree(Strings);
ObjectfindBTree(Objectobj);
intdepthBTree();..
分类:
其他好文 时间:
2015-03-04 19:29:46
阅读次数:
134
标题:Binary Tree Postorder Traversal通过率:31.8%难度:难Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,...
分类:
其他好文 时间:
2015-03-03 18:06:00
阅读次数:
93
Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the cor...
分类:
其他好文 时间:
2015-03-02 19:10:38
阅读次数:
135