
描述
Given inorder and postorder traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates do not exist in the tree.
分析
上一题的姐妹版。如法炮制即可。
PS: 从preorder和postorder是无法重建二叉树的。
代码
Python
1 |
class (object): |

Given inorder and postorder traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates do not exist in the tree.
上一题的姐妹版。如法炮制即可。
PS: 从preorder和postorder是无法重建二叉树的。
1 |
class (object): |
近期评论