public static void main(String args[]){
        int tree1[] = {3,-6,-2,11,9,-10,-1,15,10};
        int tree2[] = {3,11,9,15,-6,10,-2,-1,-10};
        IdenticalTrees it = new IdenticalTrees();
        System.out.println(it.sameBST(tree1, tree2));
        System.out.println(it.sameBST1(tree1, tree2));
    }
It might not work for duplicate elements in array. For that you have to store
both index and actual value to differentiate somehow.
src/com/interview/tree/IdenticalTrees.java