Symmetric Binary Tree

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).

Example :

    1
   / \
  2   2
 / \ / \
3  4 4  3

The above binary tree is symmetric.
But the following is not:

    1
   / \
  2   2
   \   \
   3    3

Return 0 / 1 ( 0 for false, 1 for true ) for this problem

Interview Code Editor
Hints
  • Solution Approach
  • Complete Solution
5584 successful submissions.
Asked In:
  • Amazon
Click here to jump start your coding interview preparation