Objective: – Given two binary trees check if they are mirror image of each other.
Example:

Approach:
- Do the preorder traversal on both the trees simultaneously.
- if any node doesn’t have corresponding node in the another tree, return false.
- check if left node in one tree is the right node in another tree, and vice verse.
Code:
Output:
Is Mirror Trees : true
add data check for completeness of the program
if(root1.data !=root2.data){
return false;
}
Thanks sanjib, updated it 🙂
data check should be done after null check