public boolean isIsomorphic(BSTNode<T> root1, BSTNode<T> root2) {
        // empty tree is isomorphoic
        if(root1 == null && root2 == null) {
            return true;
        } else if(root1 == null || root2 == null) {  // one of them cant be null
            return false;
        } else {
            // both the root's data should match
            if(!(root1.data.compareTo(root2.data) == 0)) {
                return false;
            }

            // recursively calculate these two cases
            // two cases  - a) both subtree rooted are not flipped
            //              b) left child and right child match and vice versa
            return (isIsomorphic(root1.left,root2.left) && isIsomorphic(root1.right,root2.right))
                    || (isIsomorphic(root1.left,root2.right) && isIsomorphic(root1.right,root2.left));

        }

    }