Welcome to the daily solving of our PROBLEM OF THE DAY with Yash Dwivedi 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 Tree but also build up problem-solving skills.
Given a Binary Tree, convert it into its mirror.
Examples:
Input:
1
/ \
2 3
Output: 3 1 2
Explanation: The tree is
1 (mirror) 1
/ \ => / \
2 3 3 2
The inorder of mirror is 3 1 2
Give the problem a try before going through the video. All the best!!!
Problem Link: https://practice.geeksforgeeks.org/problems/mirror-tree/1