private Node toBST(int preorder[],int min, int max,Index index){
        if(index.index >= preorder.length){
            return null;
        }
        if(preorder[index.index] < min || preorder[index.index] >= max){
            return null;
        }
        
        Node node = new Node();
        node.data = preorder[index.index];
        index.index++;
        node.left = toBST(preorder,min,node.data, index);
        node.right = toBST(preorder,node.data,max,index);
        return node;
    }
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