private boolean sameBST(int tree1[],int tree2[],int min,int max,int index){
        if(index ==tree1.length){
            return true;
        }
        
        int i=0;
        for(i=0; i < tree2.length; i++){
            if(tree2[i] == tree1[index]){
                break;
            }
        }
        
        BigSmall bs1 = nextBigSmall(tree1,index,min,max);
        BigSmall bs2 = nextBigSmall(tree2,i,min,max);
        
        boolean r1=  tree1[bs1.big] == tree2[bs2.big] && tree1[bs1.small] == tree2[bs2.small] ;
        if(r1 == false){
            return false;
        }
        boolean r2 = true,r3 =true;
        if(bs1.small !=  0){
            r2 = sameBST(tree1,tree2,min,tree1[index],bs1.small);
        }
        if(bs1.big != 0){
            r3 = sameBST(tree1,tree2,tree1[index],max,bs1.big);
        }
        return r2 && r3;
    }
http://www.geeksforgeeks.org/check-for-identical-bsts-without-building-the-trees/
Test cases
Both array should be same size and have exact same elements and first element should be same
src/com/interview/tree/IdenticalTrees.java