//判断两棵树是否相似 树形一样 数值不一样 8 bool IsSimilar(BTNode *t1,BTNode *t2){ if(t1==null && t2==null) return true; if(t1==null || t2==null) return false; else{ return IsSimilar(t1->lchild,t2->lchild) && IsSimilar(t1->rchild,t2->rchild); } } //判断该两棵树是否相等 9 bool IsEqual(BTNode *t1,BTNode *t2){ if(t1==null && t2==null) return true; if(t1==null || t2==null) return false; if(t1->data==t2->data){ return IsEqual(t1->lchild,t2->lchild) && IsEqual(t1->rchild,t2->rchild) }else { return false; } }