Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
22.8K+ articles
Misc
8.8K+ articles
Mathematical
7.8K+ articles
Tree
1.4K+ articles
Data Structures
1.1K+ articles
Recursion
1.0K+ articles
Binary Tree
330+ articles
Inorder Traversal
43+ articles
Preorder Traversal
39+ articles
tree-traversal
88 posts
Recent Articles
Popular Articles
Maximum Sum Level Except Triangular Number in Binary Tree
Last Updated: 23 April 2024
Given a Binary tree, Then the task is to output the maximum sum at any level excluding Triangular numbers. Xth Triangular numbers is the sum of starting X natural numbers,...
read more
Tree
Binary Tree
tree-traversal
Geeks Premier League
DSA
Geeks Premier League 2023
POTD Solutions | 21 Nov' 23 | Determine if Two Trees are Identical
Last Updated: 22 November 2023
View all POTD SolutionsWelcome to the daily solutions of ourPROBLEM OF THE DAY (POTD). We will discuss the entire problem step-by-step and work towards developing an optim...
read more
Tree
tree-traversal
Competitive Programming
DSA
GFG-POTD-Solutions
Check if a node is an Internal Node or not
Last Updated: 28 November 2023
Given a binary tree, for each node check whether it is an internal node or not.Examples:Input: Output: Node A: TrueNode B: TrueNode C: FalseNode D: FalseExplanation: In th...
read more
Tree
tree-traversal
Picked
DSA
Basic Coding Problems
Time and Space Complexity Analysis of Tree Traversal Algorithms
Last Updated: 31 May 2023
Let us discuss the Time and Space complexity of different Tree Traversal techniques, such as Inorder Traversal, Preorder Traversal, Postorder Traversal, etc.Time Complexit...
read more
Tree
Inorder Traversal
Preorder Traversal
PostOrder Traversal
tree-traversal
Data Structures-Tree Traversals
Tree Traversals
Complexity-analysis
DSA
Print the outer cone layer
Last Updated: 14 November 2022
Given a Binary tree, the task is to print the outer cone layer i.e. combination of layers formed by moving only through the left child from the root and the layer moving o...
read more
Tree
tree-traversal
Recursion
DSA
Maximize number of edges added to convert given Tree into a Bipartite Graph
Last Updated: 31 January 2023
Given a tree of N nodes, the task is to find the maximum number of edges that can be added to the tree such that it becomes a bipartite graph.Note: Self loop or multiple e...
read more
Tree
Graph
tree-traversal
Geeks-Premier-League-2022
Geeks Premier League
DSA
Convert an arbitrary Binary Tree to a tree that holds Children Sum Property - Set 2
Last Updated: 04 March 2025
Given an arbitrary binary tree, your task is to convert it to a binary tree that holds the Children Sum Property, by incrementing the data values of any node.Note: The str...
read more
Tree
Binary Tree
tree-traversal
DFS
DSA
Step by step Shortest Path from source node to destination node in a Binary Tree
Last Updated: 27 March 2023
Given a root of binary tree and two integers startValue and destValue denoting the starting and ending node respectively. The task is to find the shortest path from the st...
read more
Tree
Trees
Binary Tree
tree-traversal
Backtracking
LCA
Recursion
DSA
Find the parent node of maximum product Siblings in given Binary Tree
Last Updated: 26 December 2023
Given a binary tree, the task is to find the node whose children have maximum Sibling product in the given Binary Tree. If there are multiple such nodes, return the node w...
read more
Tree
tree-traversal
Mathematical
tree-level-order
DSA
Count of nodes in given N-ary tree such that their subtree is a Binary Tree
Last Updated: 17 March 2023
Given an N-ary tree root, the task is to find the count of nodes such that their subtree is a binary tree.Example:Input: Tree in the image belowOutput: 11Explanation: The ...
read more
Misc
Tree
PostOrder Traversal
Binary Tree
tree-traversal
n-ary-tree
DSA
Maximum count of connected duplicate nodes in given N-ary Tree
Last Updated: 24 December 2021
Given a generic tree such that each node has a value associated with it, the task is to find the largest number of connected nodes having the same value in the tree. Two n...
read more
Tree
tree-traversal
C++
Data Structures
C++ Programs
n-ary-tree
DSA
Count of nodes in a given N-ary tree having distance to all leaf nodes equal in their subtree
Last Updated: 11 January 2022
Given an N-ary tree root, the task is to find the number of non-leaf nodes in the tree such that all the leaf nodes in the subtree of the current node are at an equal dist...
read more
Tree
tree-traversal
n-ary-tree
DSA
Convert given Binary Tree to Symmetric Tree by adding minimum number of nodes
Last Updated: 02 June 2022
Given a Binary Tree, the task is to convert the given Binary Tree to the Symmetric Tree by adding the minimum number of nodes in the given Tree.Examples:Input:Output:Input...
read more
Tree
Inorder Traversal
Binary Tree
tree-traversal
Recursion
DSA
Sum of leaf nodes at each horizontal level in a binary tree
Last Updated: 06 March 2023
Given a Binary Tree, the task is to find the sum of leaf nodes at every level of the given tree.Examples:Input:Output:0063012Explanation:Level 1: No leaf node, so sum = 0L...
read more
Tree
Binary Tree
Java
tree-traversal
Queue
Python
C++
tree-level-order
TrueGeek
TrueGeek-2021
DSA
Check if all elements of given Linked List corresponds to a downward path from any node in given Binary Tree
Last Updated: 14 March 2023
Given a root of the Binary Tree and head of the Linked List, the task is to check if all the elements of the linked list corresponds to a downward path from any node in th...
read more
Linked List
Tree
Binary Tree
tree-traversal
Recursion
DSA
1
2
3
4
5
6
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !