2 つのバイナリ ツリーが本質的に同型であることを確認するアルゴリズムは何でしょうか? 私のコード-
boolean isIsomorphic(Root t1 , Root t2){
if(t1==null || t2==null){
return false;
}
if((t1.value == t2.value) && (isIsomorphic(t1.left,t2.right) && isIsomorphic(t1.right,t2.left))) {
return true
}
return false;
}