ProDeveloperTutorial.com

Tutorials and Programming Solutions
Menu
  • Shell Scripting
  • System Design
  • Linux System Programming
  • 4g LTE
  • Coding questions
  • C
  • C++
  • DSA
  • GIT

Author: prodevelopertutorial

Daily we discuss about competitive programming questions, join us at:   Telegram Channel

Get Maximum width of Binary Tree

Get Maximum width of Binary Tree

Question: Given a binary tree root node, get the maximum width of that tree Example: Consider the image given below Width at level 1 is 1. Because it has only 1 node. Width at level 2 is 2. Because it has only 2 nodes. Width at …
Full Article
No Comments
Get Sum of elements Level wise in a Binary Tree

Get Sum of elements Level wise in a Binary Tree

Question: Given a binary tree root node, get the level wise sum. Example: Consider the image given below Level 1 Sum = 16 Level 2 Sum = 10 + 25 = 35 Level 3 Sum = 7 + 15 + 18 + 30 = 70 Solution: …
Full Article
No Comments
Get Level of a Given Node

Get Level of a Given Node

Question: Given a binary tree root node, get the level of the node. Example: Consider the image given below If the given node is “25” level is 2 If the given node is “15” level is 3 Steps to get the level of a given node: …
Full Article
No Comments
Delete a binary tree

Delete a binary tree

Question: Given a binary tree root node, delete that tree Example: Consider the tree given below. How do you delete it? Here if you delete root node first, the you will loose link to left and right children. So we need to user post order traversal. …
Full Article
No Comments
Convert a binary tree to its Mirror Tree

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 image shows a tree and it’s mirror tree. From the above image we can see that, except the root node, all the other …
Full Article
No Comments
Perform PostOrder traversal on a Binary Tree by without Recursion

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 Traversal (Left, Right, Root): 7 15 10 18 30 25 16 Now lets see how to perform Post Order Traversal: (Left, Right, Root) In Post-Order …
Full Article
No Comments
Perform InOrder traversal on a Binary Tree by without Recursion

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 Traversal (Left, Root, Right): 7 10 15 16 18 25 30 Now lets see how to perform In Order Traversal: (Left, Root, Right) In In-Order …
Full Article
No Comments
Perform PreOrder traversal on a Binary Tree by without Recursion

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 Traversal(Root, Left, Right): 16 10 7 15 25 18 30 Now lets see how to perform Pre Order Traversal: (Root, Left, Right) In pre Order traversal, …
Full Article
No Comments
Display Reverse Level Order Traversal by using queue

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 the image above, reverse level order traversal is: 7, 15, 18, 30, 10, 25, 16 Solution: Solution is similar to level order traversal, …
Full Article
No Comments
Display nodes at given level in Binary Tree

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: Form the image above, Nodes at level 1 are : 16 Nodes at level 2 are : 10, 25 Nodes at level …
Full Article
No Comments

Posts navigation

Prev 1 2 3 4 5 6 … 56 Next
  • Shell Scripting
  • System Design
  • Linux System Programming
  • 4g LTE
  • Coding questions
  • C
  • C++
  • DSA
  • GIT

ProDeveloperTutorial.com

Tutorials and Programming Solutions
Copyright © 2021 ProDeveloperTutorial.com
Get top courses from: Educative.io