6-7 Isomorphic (20分)
解题思路:递归判断
int Isomorphic( Tree T1, Tree T2 ) { if(!T1&&!T2) return 1; else if(T1&&!T2) return 0; else if(!T1&&T2) return 0; else { if(T1->Element==T2->Element) { return (Isomorphic(T1->Left,T2->Left)||Isomorphic(T1->Left,T2->Right))&&(Isomorphic(T1->Right,T2->Left)||Isomorphic(T1->Right,T2->Right)); } else return 0; } }
勤能补拙,熟能生巧