private List<Node> construct(int start, int end) {
        if (start > end) {
            return Collections.singletonList(null);
        }
        List<Node> allTrees = new ArrayList<>();
        for (int root = start; root <= end; root++) {
            //get all subtrees from left and right side.
            List<Node> allLeftSubstrees = construct(start, root - 1);
            List<Node> allRightSubstrees = construct(root + 1, end);
            //iterate through them in all combination and them connect them to root
            //and add to allTrees.
            for (Node left : allLeftSubstrees) {
                for (Node right : allRightSubstrees) {
                    Node node = Node.newNode(root);
                    node.left = left;
                    node.right = right;
                    allTrees.add(node);
                }
            }
        }
        return allTrees;
    }
Date 11/07/2015
@author Tushar Roy

Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.
Total number of binary search tree possible is Catalan number.

https://leetcode.com/problems/unique-binary-search-trees-ii/
src/com/interview/tree/ConstructAllBinaryTreeFromInorderTraversal.java