• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
September 04, 2023 |1.9K Views
PROBLEM OF THE DAY: 03/09/2023 | Check if Tree is Isomorphic
  Share  2 Likes
Description
Discussion

Welcome to the daily solving of our PROBLEM OF THE DAY with Siddharth Hazra. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of binary-tree but will also help you build up problem-solving skills.

In this problem, we are given two Binary Trees. Check whether they are Isomorphic or not.

Note: 
Two trees are called isomorphic if one can be obtained from another by a series of flips, i.e. by swapping left and right children of several nodes. Any number of nodes at any level can have their children swapped. Two empty trees are isomorphic.

Example :

Input:
T1 :  1        T2:   1
    /   \              /  \
   2     3           3    2
  /                  /
 4                 4
Output: No

Give the problem a try before going through the video. All the best!!!

Problem Link: https://practice.geeksforgeeks.org/problems/check-if-tree-is-isomorphic/1
Solution IDE Link: https://ide.geeksforgeeks.org/online-cpp-compiler/0f437f75-54f3-489d-9c12-4963eda0906c

Read More