1. Preorder Tree Traversal 2. Inorder Tree Traversal 3. Postorder Tree Traversal ...
分类:
其他好文 时间:
2016-07-08 07:55:51
阅读次数:
181
Given inorder and postorder traversal of a tree, construct the binary tree. Notice You may assume that duplicates do not exist in the tree. Given inor ...
分类:
其他好文 时间:
2016-07-08 01:28:44
阅读次数:
111
Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. 利用:中序+后序遍历 c ...
分类:
其他好文 时间:
2016-06-26 23:54:52
阅读次数:
143
题目来源:http://www.lintcode.com/zh-cn/problem/binary-tree-postorder-traversal/# C++版 VS2012测试通过 ...
分类:
其他好文 时间:
2016-06-26 19:53:37
阅读次数:
152
层序遍历,使用队列将每层压入,定义两个队列来区分不同的层。 vector<vector<int>> levelorderTraversal(TreeNode *root) { vector<vector<int>> result; vector<int>tmp; //通过两个queue来区分不同的层 ...
分类:
其他好文 时间:
2016-05-28 17:45:33
阅读次数:
173
后序遍历,比先序和中序都要复杂。访问一个结点前,需要先判断其右孩子是否被访问过。如果是,则可以访问该结点;否则,需要先处理右子树。 vector<int> postorderTraversal(TreeNode *root) { vector<int> result; stack<TreeNode ...
分类:
其他好文 时间:
2016-05-28 17:20:50
阅读次数:
138
题目描述: Given a binary tree, return the postorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, return [3,2,1]. 即 给定一颗二叉树。 使 ...
分类:
其他好文 时间:
2016-05-26 18:33:48
阅读次数:
207
转载请注明出处:http://blog.csdn.net/crazy1235/article/details/51471280Subject
出处:https://leetcode.com/problems/binary-tree-postorder-traversal/
Hard 级别
Given a binary tree, return the postorder travers...
分类:
其他好文 时间:
2016-05-25 02:04:54
阅读次数:
248
题目链接:https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/
题目:
Given inorder and postorder traversal of a tree, construct the binary tree.
Note:
You may a...
分类:
其他好文 时间:
2016-05-22 12:25:05
阅读次数:
187