ProDeveloperTutorialonDecember 26, 2024 Check if Two Trees are Mirror Structure to each other Question: Given a 2 binary trees root nodes, check if the structure is mirror to each other. Example: Consider the below example: 1 …
ProDeveloperTutorialonDecember 26, 2024 Convert a binary tree to its Mirror Tree Question: Given a binary tree root node, convert that tree to it’s mirror. Example: Consider the image given below and its mirror. Above…
ProDeveloperTutorialonDecember 26, 2024 Perform PostOrder traversal on a Binary Tree by without Recursion Question: Given a binary tree root node, perform Post Order traversal by using stacks. Example: Consider the image given below: PostOrder…
ProDeveloperTutorialonDecember 26, 2024 Perform InOrder traversal on a Binary Tree by without Recursion Question: Given a binary tree root node, perform In Order traversal by using stacks. Example: Consider the image given below: InOrder…
ProDeveloperTutorialonDecember 26, 2024 Perform PreOrder traversal on a Binary Tree by without Recursion Question: Given a binary tree root node, perform PreOrder traversal by using stacks. Example: Consider the image given below: PreOrder…
ProDeveloperTutorialonDecember 26, 2024 Display Reverse Level Order Traversal by using queue Question: Given a binary tree root node, display all the nodes in reverse level order traversal. Example: Consider the image given below: Form…
ProDeveloperTutorialonDecember 26, 2024 Display nodes at given level in Binary Tree Question: Given a binary tree root node and a level, display all the nodes present in that level. Example: Consider the image given below:…
ProDeveloperTutorialonDecember 26, 2024 Get Number of Nodes in a Binary Tree Question: Given a binary tree, get the total number of nodes in it. Example: Consider the image given below: Form the image above, The total…
ProDeveloperTutorialonDecember 26, 2024 Get difference between values at Even and Odd level in a binary tree Question: Given a binary tree, get the difference of the sum of the nodes at odd level and sum of the nodes at even level. Example: Consider…
ProDeveloperTutorialonDecember 26, 2024 Given an array, that has zero. Move all the zero at the end, but maintain the relative order of other elements. Example: array = [3, 4, 0, 5, 6, 0 , 7, 1, 0, 3] Output: [3, 4, 5, 6, 7, 1, 3, 0, 0, 0] The solution is very simple. We take 2 loops. In the…