InterviewBit Academy is now Scaler!
Learn Tech Skills from Scratch @ Scaler EDGE

Symmetric Binary Tree

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

Example :

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

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

   / \
  2   2
   \   \
   3    3

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

NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.
Start solving Symmetric Binary Tree on Interview Code Editor
Sign Up
to access hints and editorial solutions for Symmetric Binary Tree
Asked In:


Click here to start solving coding interview questions