真二叉树重构(Proper Rebuild)
真二叉树重构(Proper Rebuild) Description In general, given the preorder traversal sequence and postorder traversal sequence of a binary tree, we cannot determine the binary tree. Figure 1 In Figure 1 for example, although they are two different binary tree, their preorder traversal sequence and postorder traversal sequence are both of the same. But for one proper binary tree, in which each internal node has two sons, we can uniquely determine it through its given preorder traversal sequence and postorder traversal sequence. Label n nodes in one binary tree using the integers in [1, n], we would like