Concept Flow - Check if Two Trees are Symmetric
Start with two root nodes
Are both nodes nil?
Yes→Return True
No
Is one node nil?
Yes→Return False
No
Do nodes have same value?
No→Return False
Yes
Check left subtree of first with right subtree of second
Check right subtree of first with left subtree of second
Return True if both checks True, else False
The function compares two trees node-by-node to check if they are mirror images, returning true only if all corresponding nodes match symmetrically.