Given a binary tree, return the postorder traversal of its nodes’ values.For example:
Given binary tree {1,#,2,3},
return [3,2,1].Note: Recursive solution is trivial, could you do it iteratively?二叉...
分类:
其他好文 时间:
2015-07-14 13:47:27
阅读次数:
181
该题的思路很明确就是将中缀表达式转换为后缀表达式,然后通过后缀表达式来求值。
class Solution {
public:
int calculate(string s) {
vector postorder;
stack ccache;
stack icache;
string tmp;
...
分类:
其他好文 时间:
2015-07-14 13:35:57
阅读次数:
83
Binary Tree Preorder Traversal 题目链接 题目要求: Given a binary tree, return thepreordertraversal of its nodes' values. For example: Given binary tree{1...
分类:
其他好文 时间:
2015-07-09 13:04:42
阅读次数:
91
题目:
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].
解题:
递归的还是和前面中...
分类:
编程语言 时间:
2015-07-09 11:16:06
阅读次数:
179
LeetCode_Construct Binary Tree from Inorder and Postorder Traversal 解题思路...
分类:
其他好文 时间:
2015-06-29 20:26:47
阅读次数:
82
Given preorder and inorder (Inorder and Postorder) traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates do not exist in the tree.
前序和后序的特点是根结点要么在最前面、要么在最后...
分类:
其他好文 时间:
2015-06-22 09:56:49
阅读次数:
138
Description:Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.Co...
分类:
其他好文 时间:
2015-06-20 15:39:21
阅读次数:
108
Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1].No...
分类:
其他好文 时间:
2015-06-14 16:24:41
阅读次数:
112
http://bookshadow.com/weblog/2015/01/19/leetcode-binary-tree-postorder-traversal/http://bookshadow.com/weblog/2015/01/19/binary-tree-post-order-traver...
分类:
其他好文 时间:
2015-06-13 12:36:30
阅读次数:
111
Given a binary tree, return the postorder traversal of its nodes’ values.For example:
Given binary tree {1,#,2,3}, 1
2
/
3return [3,2,1].Note: Recursive solution is trivial, could...
分类:
其他好文 时间:
2015-06-13 11:23:14
阅读次数:
113