@@ -0,0 +1,1537 @@
+public class LintCode0072 %7B%0A    class TreeNode %7B%0A        public int val;%0A        public TreeNode left, right;%0A        public TreeNode(int val)%0A        %7B%0A            this.val = val;%0A            this.left = this.right = null;%0A        %7D%0A    %7D%0A    public TreeNode buildTree(int%5B%5D inorder, int%5B%5D postorder)%0A    %7B%0A        if (inorder == null %7C%7C postorder == null)%0A            return null;%0A        if (inorder.length == 0 %7C%7C postorder.length == 0)%0A            return null;%0A        if (inorder.length != postorder.length)%0A            return null;%0A%0A        TreeNode root = helper(inorder, 0, inorder.length - 1,%0A            postorder, 0, postorder.length - 1);%0A        return root;%0A    %7D%0A%0A    private TreeNode helper(int%5B%5D inorder, int instart, int inend,%0A        int%5B%5D postorder, int poststart, int postend)%0A    %7B%0A%0A        if (instart %3E inend %7C%7C poststart %3E postend)%0A            return null;%0A%0A        int root_val = postorder%5Bpostend%5D;%0A        TreeNode root = new TreeNode(root_val);%0A%0A        int index = findIndex(inorder, instart, inend, root_val);%0A%0A        root.left = helper(inorder, instart, index - 1,%0A            postorder, poststart, poststart + index - instart - 1);%0A%0A        root.right = helper(inorder, index + 1, inend,%0A            postorder, poststart + index - instart, postend - 1);%0A        return root;%0A    %7D%0A%0A    private int findIndex(int%5B%5D nums, int start, int end, int target)%0A    %7B%0A        for (int i = start; i %3C= end; i++) %7B%0A            if (nums%5Bi%5D == target)%0A                return i;%0A        %7D%0A        return -1;%0A    %7D%0A%7D%0A

Add LintCode0072.java