Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine if two binary trees are equal

Tags:

People also ask

Is same binary tree?

Two binary trees are identical if: their root nodes have the same value, their left subtree is identical, their right subtree is identical.

Can two different trees have the same traversal?

It is also mentioned that the in-order traversal of two different trees can be the same though they are structurally different.


What would be the efficient algorithm to find if two given binary trees are equal - in structure and content?