Build Binary Tree from pre and in order
1. Use list subList like substring[startIndex, endIndex]
2. Get the left and right subtree from inorder with root node in preorder

3. Build Binary Tree from post and in order. It is similar to pre and in order.

pre order [root][left substree] [right substree]
in order [left substree][root][right substree]

post order [left substree][right substree][root]
in order [left substree][root][right substree]

pre order [root] [left substree][right substree]
post order [left substree][right substree][root]
pre and post order can't be build general Binary Tree, but a full Binary Tree can be built.

public static Node buildTree(List<Integer> oPreOrder, List<Integer> oInorder) {
Node parent = null;
if(oPreOrder.size() > 0 || oInorder.size() > 0) {
parent = new Node(oPreOrder.get(0));

ArrayList<Integer> inLeft = (ArrayList<Integer>) left(oInorder, oPreOrder);
ArrayList<Integer> inRight = (ArrayList<Integer>) right(oInorder, oPreOrder);

parent.left = buildTree(oPreOrder.subList(1, inLeft.size() + 1), inLeft);
parent.right = buildTree(oPreOrder.subList(inLeft.size() + 1, oPreOrder.size()), inRight);
}
return parent;
}

public static List<Integer> left(List<Integer> inList, List<Integer> preList){
List<Integer> list = new ArrayList<Integer>();
if(preList.size() > 0){
for(int i=0; i<inList.size(); i++){
if(preList.get(0) != inList.get(i))
else
break;
}
}
return list;
}

public static List<Integer> right(List<Integer> inList, List<Integer> preList){
List<Integer> list = new ArrayList<Integer>();
if(preList.size() > 0){
boolean valid = false;
for(int i=0; i<inList.size(); i++){
if(valid)