![]() |
VOOZH | about |
Given two Binary Trees, returns true if two trees are mirror of each other, else false.
Mirror Tree :
Previously discussed approach is here.
Approach: Find the inorder traversal of both the Binary Trees, and check whether one traversal is reverse of another or not. If they are reverse of each other then the trees are mirror of each other, else not.
Implementation
Yes
Time Complexity: O(NlogN)
Auxiliary Space: O(N)