摘要:
有二叉树的前序遍历和后序遍历,构造二叉树/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */public class Solution { public TreeNode buildTree(int[] preorder, int[] inorder) { HashMap map = new HashMap (); f... 阅读全文