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
Tree
911+ articles
Binary Tree
330+ articles
Data Structures
150+ articles
tree-level-order
123+ articles
tree-traversal
88+ articles
cpp-queue
63+ articles
Preorder Traversal
39+ articles
Data Structures-Stack
9+ articles
Data Structures-Tree Traversals
10 posts
Recent Articles
Popular Articles
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
Minimum operation to make every leaf node equal
Last Updated: 23 July 2025
Given a binary tree that contains multiple nodes, the task is to find a minimum number of operations required to make leaf nodes at the same level equal. By performing one...
read more
Tree
DSA
Binary Tree
Data Structures-Tree Traversals
tree-level-order
Kahn's Algorithm vs DFS Approach: A Comparative Analysis
Last Updated: 19 October 2023
Topological sorting is a common problem in computer science that involves arranging the vertices of a directed acyclic graph (DAG) in a linear order such that for every di...
read more
Graph
Stack
Sorting
DSA
Topological Sorting
graph-connectivity
Data Structures
Data Structures-Tree Traversals
Data Structures-Stack
Data Structures-Graph
Find maximum GCD value from root to leaf in a Binary tree
Last Updated: 15 July 2025
Given a Binary Tree, the task is to find the maximum value of GCD from any path from the root node to the leaf node.Examples:Input: Below is the given tree:Output: 3Explan...
read more
Tree
Greedy
Recursion
DSA
Preorder Traversal
Binary Tree
tree-traversal
GCD-LCM
Data Structures
Data Structures-Tree Traversals
Tree Traversals
Traversal
Difference between sum of even and odd valued nodes in a Binary Tree
Last Updated: 21 March 2023
Given a binary tree, the task is to find the absolute difference between the even valued and the odd valued nodes in a binary tree.Examples:Input: 5 / \ 2 ...
read more
DSA
Binary Tree
interview-preparation
Data Structures-Tree Traversals
Real-life Applications of Data Structures and Algorithms (DSA)
Last Updated: 03 October 2025
You may have heard that DSA is primarily used in the field of computer science. Although DSA is most commonly used in the computing field, its application is not restricte...
read more
DSA
Data Structures
Data Structures-Binary Trees
Data Structures-Tree Traversals
Data Structures-Linked List
Data Structures-Stack
Data Structures-Queue
Data Structures-Graph
Data Structures-Balanced Binary Search Trees
Data Structures-Hash
Data Structures-Array
Data Structures-Misc
Data Structures-B and B+ Trees
Data Structures-Heap
How to insert a node in Binary Search Tree using Iteration
Last Updated: 17 August 2022
You are given a binary search tree (BST) and a value to insert into the tree. Print inorder traversal of the BST after the insertion.Example:Input:To the given BST insert ...
read more
Tree
Binary Search Tree
Picked
DSA
Data Structures-Tree Traversals
Root to leaf path sum equal to a given number in BST
Last Updated: 11 July 2025
Given a Binary Search Tree and a sum target. The task is to check whether the given sum is equal to the sum of all the node from root leaf across any of the root to leaf p...
read more
Binary Search Tree
DSA
Preorder Traversal
Microsoft
tree-traversal
Data Structures-Tree Traversals
Check if two nodes are cousins in a Binary Tree using BFS
Last Updated: 11 July 2025
Given a binary tree (having distinct node values) root and two node values. The task is to check whether the two nodes with values a and b are cousins.Note: Two nodes of a...
read more
Tree
DSA
Binary Tree
Data Structures-Tree Traversals
cpp-queue
tree-level-order
Check if two trees are mirror of each other using level order traversal
Last Updated: 11 July 2025
Given two binary trees, the task is to check whether the two binary trees is a mirror of each other or not.Mirror of a Binary Tree: Mirror of a Binary Tree T is another Bi...
read more
DSA
Mirror Tree
Binary Tree
Data Structures-Tree Traversals
cpp-queue