@@ -0,0 +1,1452 @@
+package me.wayne.leetcodetop100.binarytree;%0A%0Aimport me.wayne.leetcodetop100.TreeNode;%0A%0A/**%0A * %E7%BB%99%E5%AE%9A%E4%B8%A4%E4%B8%AA%E6%95%B4%E6%95%B0%E6%95%B0%E7%BB%84 preorder %E5%92%8C inorder %EF%BC%8C%E5%85%B6%E4%B8%AD preorder %E6%98%AF%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E5%85%88%E5%BA%8F%E9%81%8D%E5%8E%86%EF%BC%8C%0A * inorder %E6%98%AF%E5%90%8C%E4%B8%80%E6%A3%B5%E6%A0%91%E7%9A%84%E4%B8%AD%E5%BA%8F%E9%81%8D%E5%8E%86%EF%BC%8C%E8%AF%B7%E6%9E%84%E9%80%A0%E4%BA%8C%E5%8F%89%E6%A0%91%E5%B9%B6%E8%BF%94%E5%9B%9E%E5%85%B6%E6%A0%B9%E8%8A%82%E7%82%B9%E3%80%82%0A * %3Cp%3E%0A * %E9%93%BE%E6%8E%A5%EF%BC%9Ahttps://leetcode-cn.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal%0A */%0Apublic class LC105_BuildTree %7B%0A%0A    public TreeNode buildTree(int%5B%5D preorder, int%5B%5D inorder) %7B%0A        if (preorder.length == 0) %7B%0A            return null;%0A        %7D%0A%0A        TreeNode root = new TreeNode(preorder%5B0%5D);%0A        int rootIndex = 0;%0A        for (int i = 0; i %3C inorder.length; i++) %7B%0A            if (inorder%5Bi%5D == root.val) %7B%0A                rootIndex = i;%0A                break;%0A            %7D%0A        %7D%0A%0A        int%5B%5D leftInorder = new int%5BrootIndex%5D;%0A        System.arraycopy(inorder, 0, leftInorder, 0, leftInorder.length);%0A        int%5B%5D rightInorder = new int%5Binorder.length - leftInorder.length - 1%5D;%0A        System.arraycopy(inorder, leftInorder.length + 1, rightInorder, 0, rightInorder.length);%0A%0A        int%5B%5D leftPreorder = new int%5BleftInorder.length%5D;%0A        System.arraycopy(preorder, 1, leftPreorder, 0, leftPreorder.length);%0A        int%5B%5D rightPreorder = new int%5BrightInorder.length%5D;%0A        System.arraycopy(preorder, leftInorder.length + 1, rightPreorder, 0, rightPreorder.length);%0A%0A        root.left = buildTree(leftPreorder, leftInorder);%0A        root.right = buildTree(rightPreorder, rightInorder);%0A%0A        return root;%0A    %7D%0A%7D%0A

add LC105_BuildTree