package leetcode;

/**
 * https://leetcode.com/problems/construct-binary-tree-from-preorder-and-postorder-traversal/
 */
public class Problem889 {
    public static class TreeNode {
        int val;
        TreeNode left;
        TreeNode right;

        TreeNode(int x) {
            val = x;
        }
    }

    public TreeNode constructFromPrePost(int[] pre, int[] post) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem889 prob = new Problem889();
    }
}

@@ -423,88 +423,1189 @@
    p
-ublic static void main(String%5B%5D args) %7B%0A        Problem889 prob = new Problem889
+rivate static void preOrder(TreeNode node) %7B%0A        if (node == null) %7B%0A            return;%0A        %7D%0A        System.out.print(node.val + %22 %22);%0A        preOrder(node.left);%0A        preOrder(node.right);%0A    %7D%0A%0A    private static void inOrder(TreeNode node) %7B%0A        if (node == null) %7B%0A            return;%0A        %7D%0A        inOrder(node.left);%0A        System.out.print(node.val + %22 %22);%0A        inOrder(node.right);%0A    %7D%0A%0A    private static void postOrder(TreeNode node) %7B%0A        if (node == null) %7B%0A            return;%0A        %7D%0A        postOrder(node.left);%0A        postOrder(node.right);%0A        System.out.print(node.val + %22 %22);%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem889 prob = new Problem889();%0A        TreeNode root = new TreeNode(1);%0A        root.left = new TreeNode(2);%0A        root.right = new TreeNode(3);%0A        root.left.left = new TreeNode(4);%0A        root.left.right = new TreeNode(5);%0A        root.right.left = new TreeNode(6);%0A        root.right.right = new TreeNode(7);%0A%0A        preOrder(root);%0A        System.out.println();%0A%0A        inOrder(root);%0A        System.out.println();%0A%0A        postOrder(root);%0A        System.out.println
 ();%0A

Update problem 889