Wednesday, August 15, 2007

Write C code to determine if two trees are identical .

Here is a C program using recursion


int identical(struct node* a, struct node* b)
{
if (a==NULL && b==NULL){return(true);}
else if (a!=NULL && b!=NULL)
{
return(a->data == b->data &&
identical(a->left, b->left) &&
identical(a->right, b->right));
}
else return(false);
}

5 comments:

Unknown said...

Thanks for the info.
Regards
Educational site

Anonymous said...

I feel that is among the most significant info for me.
And i'm happy studying your article. However wanna observation on some general issues, The website style is perfect, the articles is in point of fact great : D. Good job, cheers

Stop by my page - Bmi Calculator Women

Unknown said...

"Great post! |3uy ch34p v14gr4 w1th fr33 5h199ing." Amc Square Reviews, Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews

Unknown said...

"Great post! |3uy ch34p v14gr4 w1th fr33 5h199ing." Amc Square Reviews, Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews,Amc Square Reviews

youtubecomactivate said...

If someone needs YouTube related support first visit youtube.com/activate. Follow these given instructions and simple methods to fix YouTube issues by your hand. After that you facing issues with YouTube you can contact us, our professional expert team will resolve your issues instantly.