前序中序遍历重建二叉搜索树Reconstrunct Binary Tree from Preorder and Inorder前序中序遍历重建二叉搜索树
Reconstrunct Binary Tree from Preorder and Inorder前序中序遍历重建二叉搜索树问题描述给定一个二叉树前序遍历和中序遍历结果,重建这个二叉树。测试样例# Input: preorder = ['a', 'b', 'd', 'e', 'c', 'f', 'g']inorder = ['d', 'b', 'e', 'a', 'f', 'c', 'g']# Output: abcdefg# 该二叉树为# a# / \# b