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++ | , ,

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s