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
Searching
1.7K+ articles
Tree
1.4K+ articles
Data Structures
1.1K+ articles
Recursion
1.0K+ articles
Binary Tree
330+ articles
Tree Traversals
106+ articles
Inorder Traversal
43+ articles
Preorder Traversal
39+ articles
PostOrder Traversal
37 posts
Recent Articles
Popular Articles
Count pairs of leaf nodes in a Binary Tree which are at most K distance apart
Last Updated: 21 June 2021
Given a binary tree and an integer K, the task is to count the possible pairs of leaf nodes from the given binary tree such that the distance between them is at most K.Exa...
read more
Tree
Searching
Recursion
DSA
PostOrder Traversal
Binary Tree
Tree Traversals
Length of longest straight path from a given Binary Tree
Last Updated: 28 December 2023
Given a Binary Tree, the task is to find the length of the longest straight path of the given binary tree.Straight Path is defined as the path that starts from any node an...
read more
Tree
Greedy
Searching
Competitive Programming
Recursion
C++
DSA
Trees
PostOrder Traversal
Tree Traversals
Remove nodes from Binary Tree such that sum of all remaining root-to-leaf paths is atleast K
Last Updated: 29 October 2024
Given a Binary Tree and an integer k, the task is to delete nodes from the given Tree such that the sum of all nodes of all remaining root-to-leaf paths is at least k.Exam...
read more
Tree
Recursion
DSA
Preorder Traversal
PostOrder Traversal
Tree Traversals
morris-traversal
Sum of nodes having sum of subtrees of opposite parities
Last Updated: 30 May 2022
Given a Binary Tree, the task is to find the sum of all such nodes from the given tree whose sum of left and right subtree is either odd and even or even and odd respectiv...
read more
Tree
Recursion
DSA
PostOrder Traversal
DFS
Basic Operations on Binary Tree with Implementations
Last Updated: 24 February 2025
The tree is a hierarchical Data Structure. A binary tree is a tree that has at most two children. The node which is on the left of the Binary Tree is called “Left-Child” a...
read more
Tree
Technical Scripter
Internship
Recursion
Technical Scripter 2020
DSA
Inorder Traversal
Preorder Traversal
PostOrder Traversal
Binary Tree
tree-traversal
tree-level-order
Experiences
Preorder, Postorder and Inorder Traversal of a Binary Tree using a single Stack
Last Updated: 18 January 2022
Given a binary tree, the task is to print all the nodes of the binary tree in Pre-order, Post-order, and In-order iteratively using only one stack traversal.Examples:Input...
read more
Tree
Stack
Algorithms
DSA
Inorder Traversal
Preorder Traversal
PostOrder Traversal
Binary Tree
Tree Traversals
cpp-stack
Minimum number of cameras required to monitor all nodes of a Binary Tree
Last Updated: 18 June 2021
Given a Binary Tree consisting of N nodes, the task is to find the minimum number of cameras required to monitor the entire tree such that every camera placed at any node ...
read more
Tree
Dynamic Programming
Mathematical
Recursion
DSA
PostOrder Traversal
Binary Tree
tree-traversal
DFS
Trim given Binary Tree for any subtree containing only 0s
Last Updated: 28 January 2022
Given a Binary tree, the task is to trim this tree for any subtree containing only 0s.Examples:Input: 1 \ 0 / \ ...
read more
Tree
DSA
PostOrder Traversal
Binary Tree
Minimize absolute difference between sum of subtrees formed after splitting Binary tree into two
Last Updated: 16 September 2021
Given a binary tree consisting of N nodes, the task is to split the binary tree into two subtrees by removing one edge such that the absolute difference of the sum of the ...
read more
Tree
Greedy
Data Structures
DSA
Preorder Traversal
PostOrder Traversal
Count the number of common ancestors of given K nodes in a N-ary Tree
Last Updated: 15 February 2023
Given an N-ary tree root and a list of K nodes, the task is to find the number of common ancestors of the given K nodes in the tree.Example:Input: root = 3 / \ ...
read more
Tree
Blogathon
DSA
PostOrder Traversal
n-ary-tree
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
DSA
PostOrder Traversal
Binary Tree
tree-traversal
n-ary-tree
Morris traversal for Postorder
Last Updated: 18 July 2024
Perform Postorder Tree traversal using Morris Traversal.Examples:Input: 1 / \ 2 3 / \ / \ 6 7 8 9Output: 6 7 2 8 9 3 1Input: ...
read more
Tree
DSA
PostOrder Traversal
morris-traversal
Elite-Batch-2022
Convert given binary tree to a XOR tree
Last Updated: 09 May 2022
Given a Binary Tree where each node has a value of either 0 or 1, the task is to convert the given Binary tree to an XOR tree i.e a tree such that each node value is the l...
read more
Tree
Recursion
DSA
PostOrder Traversal
Binary Tree
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
DSA
Inorder Traversal
Preorder Traversal
PostOrder Traversal
tree-traversal
Data Structures-Tree Traversals
Tree Traversals
Complexity-analysis
Preorder vs Inorder vs Postorder
Last Updated: 17 April 2024
InPreorder Traversal, the root node is visited first, followed by the left and right subtrees.Inorder Traversalstarts with the left subtree, visits the root, and then the ...
read more
Tree
DSA
Trees
Inorder Traversal
Preorder Traversal
PostOrder Traversal
1
2
3
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 !