二叉树结构是否相同

bool strcutcmp(BiTNode *pRoot1,BiTNode *pRoot2)
{
	if (pRoot1 == NULL && pRoot2 == NULL)
	{
		return true;
	}
	if (pRoot1 == NULL || pRoot2 ==NULL)
	{
		return false;
	}
	bool left = strcutcmp(pRoot1->lchild,pRoot2->lchild);
	bool right = strcutcmp(pRoot1->rchild,pRoot2->rchild);
	return left && right;
}

 

posted @ 2013-08-27 20:15  l851654152  阅读(204)  评论(0)    收藏  举报