bool Symmetric(BinNode *left,BinNode *right){
	if(left == NULL && right == NULL) return true;
	else if(left != NULL && right != NULL){
		return (left->data == right->data && Symmetric(left->lchild,right->rchild) && Symmetric(left->rchild,right->lchild));
	}else{
		return false;
	}
}
Esempio n. 2
0
 Group Group::symmetric(int n)  {return Group(Symmetric(n)); }
bool IsSymmetricTree(BinTree r){
 	if (r == NULL) return false;
 	return Symmetric(r->lchild,r->rchild);
}