Structurally idencial

1 test case not passing
https://online.codingblocks.com/app/player/33759/content/33245/4966

Hey @RUPESH
Just remove the condition
root1->data==root2->data
from your function while comparing the two non-null nodes because for two trees to be identical, it’s not necessary that the data of all the nodes is same, it just compares structure not data.

1 Like

THANK YOU, I understood my mistake; my doubt is resolved but is their a more optimized way to do this??

1 Like

No, but if you can come with something, it’d be great!

1 Like