Ronzii's Blog

Just your average geek's blog

Mirror Tree Comparision

int checkMirror(Node* a, node* b)
{
	if(a==NULL && b==NULL)
		return 1;
	else if(a==NULL || b==NULL)
		return 0;
	else if(a->data == b->data)
	{
		return checkMirror(a->left,b->right) && checkMirror(a->right,b->left);
	}
	return 0;
}
Advertisements

February 26, 2012 Posted by | C++ | , , | Leave a comment