public static void main(String args[]){
        int preorder[] = {10,5,1,7,40,50};
        ConstructBSTFromPreOrderArray poa = new ConstructBSTFromPreOrderArray();
        Node root = poa.toBST(preorder);
        TreeTraversals tt = new TreeTraversals();
        tt.preOrder(root);
        System.out.println();
        tt.inOrder(root);
    }
http://www.geeksforgeeks.org/construct-bst-from-given-preorder-traversa/
Test case
empty array
1,2 or more elements in the array
src/com/interview/tree/ConstructBSTFromPreOrderArray.java