public boolean isMirrorTrees(BinaryTree T1, BinaryTree T2) {
if(T1==null && T2==null)
return true;
if(T1.data!=T2.data)
return false;
if((T1==null && T2!=null) || (T2==null && T1!=null))
return false;
if(isMirrorTrees(T1.left, T2.right)
&& isMirrorTrees(T2.left, T1.right))
return true;
return false;
}
No comments:
Post a Comment