Courses
Tutorials
Interview Prep
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
Similar Topics
Web Technologies
32.1K+ articles
DSA
20.4K+ articles
Misc
7.7K+ articles
Tree
911+ articles
Recursion
591+ articles
Binary Tree
330+ articles
Tree Traversals
106+ articles
tree-traversal
88+ articles
Inorder Traversal
43+ articles
Preorder Traversal
39+ articles
PostOrder Traversal
37 posts
Recent Articles
Popular Articles
Preorder vs Inorder vs Postorder
Last Updated: 23 July 2025
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
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
Convert given binary tree to a XOR tree
Last Updated: 23 July 2025
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
Morris traversal for Postorder
Last Updated: 08 October 2025
Given the root of a binary tree, Find its postorder traversal using Morris Traversal, i.e., without using recursion or a stack.Examples:Input: Output: [4, 5, 2, 3, 1]...
read more
Tree
DSA
PostOrder Traversal
morris-traversal
Elite-Batch-2022
Count of nodes in given N-ary tree such that their subtree is a Binary Tree
Last Updated: 23 July 2025
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
Count the number of common ancestors of given K nodes in a N-ary Tree
Last Updated: 23 July 2025
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
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
DSA
Preorder Traversal
PostOrder Traversal
Trim given Binary Tree for any subtree containing only 0s
Last Updated: 23 July 2025
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
Preorder, Postorder and Inorder Traversal of a Binary Tree using a single Stack
Last Updated: 23 July 2025
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
DSA
Inorder Traversal
Preorder Traversal
PostOrder Traversal
Binary Tree
Tree Traversals
cpp-stack
Basic Operations on Binary Tree with Implementations
Last Updated: 23 July 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
Minimum number of cameras required to monitor all nodes of a Binary Tree
Last Updated: 23 July 2025
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
Sum of nodes having sum of subtrees of opposite parities
Last Updated: 23 July 2025
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
Remove nodes from Binary Tree such that sum of all remaining root-to-leaf paths is atleast K
Last Updated: 23 July 2025
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
Length of longest straight path from a given Binary Tree
Last Updated: 15 July 2025
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
DSA
Trees
PostOrder Traversal
Tree Traversals
Count pairs of leaf nodes in a Binary Tree which are at most K distance apart
Last Updated: 15 July 2025
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
1
2
3