Check if a Binary Tree is isomorphic

                boolean isIsomorphic(Node r1, Node r2){
                    if((r1 != null && r2 == null) || (r1 == null && r2 != null)){
                       return false; 
                    }else{
                        if(r1 == null && r2 == null){
                            return true;
                        }
                        else{
                            if(r1.data == r2.data){
                                return isIsomorphic(r1.left, r2.left) && isIsomorphic(r1.right, r2.right) ||
                                       isIsomorphic(r1.left, r2.right) && isIsomorphic(r1.right, r2.left);
                            }
                        }
                    }
                    return false;
                }