Skip to content
DSA
Data Structures
Arrays
Matrix
Strings
Linked List
Singly Linked List
Doubly Linked List
Circular Linked List
Doubly Circular Linked List
Linked List Tutorial
Stack
Queue
Tree
Generic Tree
Binary Tree
Binary Search Tree
AVL Tree
B Tree
B+ Tree
Red Black Tree
Tree Data Structure Tutorial
Heap
Hashing
Graph
Set Data Structure
Map Data Structure
Advanced Data Structure
Data Structures Tutorial
Algorithms
Analysis of Algorithms
Design and Analysis of Algorithms
Asymptotic Analysis
Asymptotic Notations
Worst, Average and Best Cases
Searching Algorithms
Linear Search
Binary Search
Searching Algorithms Tutorial
Sorting Algorithms
Selection Sort
Bubble Sort
Insertion Sort
Merge Sort
Quick Sort
Heap Sort
Counting Sort
Radix Sort
Bucket Sort
Sorting Algorithms Tutorial
Greedy Algorithms
Dynamic Programming
Graph Algorithms
Pattern Searching
Recursion
Backtracking
Divide and Conquer
Mathematical Algorithms
Geometric Algorithms
Bitwise Algorithms
Randomized Algorithms
Branch and Bound
Algorithms Tutorial
DSA Tutorial
Competitive Programming
Company Wise SDE Sheets
Facebook SDE Sheet
Amazon SDE Sheet
Apple SDE Sheet
Netflix SDE Sheet
Google SDE Sheet
Wipro Coding Sheet
Infosys Coding Sheet
TCS Coding Sheet
Cognizant Coding Sheet
HCL Coding Sheet
DSA Cheat Sheets
SDE Sheets
FAANG Coding Sheet
Love Babbaar Sheet
Mass Recruiter Sheet
Product-Based Coding Sheet
Company-Wise Preparation Sheet
Top Interview Questions
Top 100 DSA Interview Questions Topic-wise
Top 50 Array Problems
Top 50 String Problems
Top 50 Problems on Stack
Top 50 Problems on Heap
Top 20 Linked List Interview Question
Top 50 Tree Problems
Top 50 Graph Problems
Top 50 Problems on Recursion
Top 20 Greedy Algorithms Interview Questions
Top 50 Dynamic Programming (DP) Problems
Top 20 Hashing Technique based Interview Questions
Top 20 Dynamic Programming Interview Questions
Top 10 algorithms in Interview Questions
Commonly Asked Data Structure Interview Questions
Puzzles
All Puzzles
Top 100 Puzzles Asked In Interviews
Top 20 Puzzles Commonly Asked During SDE Interviews
Top MCQs on Puzzles with Answers
Crossword Puzzle Of The Week
Tutorials
Programming Languages
C
C++
Python
R
Golang
C#
Swift
Kotlin
Scala
Perl
Java
Java Tutorial
Java Collection
Java 8 Tutorial
Java Advance
Spring Tutorial
Spring Boot Tutorial
Spring MVC Tutorial
Hibernate Tutorial
Java Interview Questions
Java Interview Questions
Multithreading Interview Questions
Collection Interview Quesions
Java Programs
Java Projects
CS Subjects
Mathematics
Operating System
DBMS
Computer Networks
Computer Organization and Architecture
Theory of Computation
Compiler Design
Digital Logic
Software Engineering
System Design
System Design Tutorial
What is System Design
Key Terminologies in System Design
Analysis and Architecture of Systems
Scalability in System Design
Databases in System Design
High Level Design or HLD
Low Level Design or LLD
Communication Protocols
Web Servers and Proxies
Case Studies in Designing Systems
Complete System Design Tutorial
System Design Patterns
Factory Pattern
Observer Pattern
Singleton Design Pattern
Decorator Pattern
Strategy Pattern
Adapter Pattern
Command Pattern
Iterator Pattern
Prototype Design Pattern
All Design Patterns
System Design Roadmap
Top 10 System Design Interview Questions and Answers
DevOps
Git
AWS
Docker
Kubernetes
Microsoft Azure Tutorial
Google Cloud Platform
SQL Tutorial
Interview Questions
C Interview Questions
C++ Interview Questions
STL Interview Questions
Java Interview Questions
Python Interview Questions
R Interview Questions
SQL Interview Questions
Linux Interview Questions
C# Interview Questions
Android Interview Questions
Flutter Interview Questions
Operating System Interview Questions
Computer Network Interview Questions
Software Engineering Interview Questions
CCNA Interview Questions
Ethical Hacking Interview Questions
Interview Corner
Company Preparation
Top Topics
Practice Company Questions
Interview Experiences
Experienced Interviews
Internship Interviews
Competitive Programming
Multiple Choice Quizzes
Aptitude for Placements
Projects
C++ Projects
Java Projects
Python Projects
Machine Learning Projects
Android Projects
Cheat Sheets
C CheatSheet
C++ CheatSheet
C++ STL CheatSheet
Python CheatSheet
Docker CheatSheet
Kubernetes CheatSheet
Computer Network CheatSheet
CCNA CheatSheet
Ethical Hacking CheatSheet
Quizzes
C Quiz
C++ Quiz
Java Quiz
Python Quiz
DBMS Quiz
Operating System Quiz
Computer Network Quiz
COA Quiz
ML & Data Science
Python Tutorial
R Tutorial
Machine Learning
Machine Learning Maths
Machine Learning Tutorial
Machine Learning Projects
Data Science using Python
Data Science using R
Data Science Packages
Pandas Tutorial
NumPy Tutorial
Data Visualization
Data Visualization with Python
Python Data Visualization Tutorial
Matplotlib Tutorial
Bokeh Tutorial
Plotly Tutorial
Seaborn Tutorial
Data Visualization with R
Data Visualization with R
Plotly Tutorial
ggplot Tutorial
Data Visualization Tools
Tableau
Power BI
Data Analysis
Data Analysis with Python
Data Analysis with R
Deep Learning
Deep Learning Tutorial
Deep Learning Projects
NLP Tutorial
OpenCV Tutorial
Interview Questions
Machine Learning Interview Question
Deep Learning Interview Question
Python Interview Questions
Top 50 R Interview Questions
ML Frameworks
Tensorflow
PyTorch
PyTorch Lightning
Web Development
HTML
CSS
JavaScript
PHP
Bootstrap Tutorial
CSS Frameworks
Tailwind CSS
Foundation CSS
Materialize CSS
Bulma
Pure CSS
Primer CSS
Blaze UI
Semantic UI
JavaScript Frameworks
AngularJS
Angular PrimeNG
Angular ngx Bootstrap
NodeJS
Express.js
JavaScript Libraries
jQuery
jQuery Mobile
jQuery UI
jQuery EasyUI
jQWidgets
ReactJS
React Bootstrap
React Rebass
React Desktop
React Suite
ReactJS Evergreen
ReactJS Reactstrap
Ant Design
BlueprintJS
p5.js
Lodash
TensorFlow.js
Moment.js
Collect.js
Django Tutorial
WordPress
JSON
Web Dev Cheat Sheets
HTML Cheat Sheet
CSS Cheat Sheet
Bootstrap Cheat Sheet
JS Cheat Sheet
jQuery Cheat Sheet
Angular Cheat Sheet
Practice
All DSA Problems
Problem of the Day
GFG SDE Sheet
Curated DSA Lists
Beginner's DSA Sheet
Love Babbar Sheet
Top 50 Array Problems
Top 50 String Problems
Top 50 DP Problems
Top 50 Graph Problems
Top 50 Tree Problems
Home
Saved Videos
Courses
Data Structures and Algorithms
DSA Tutorial
Data Structures Tutorial
Algorithms Tutorial
Top 100 DSA Interview Questions
DSA-Roadmap[Basic-to-Advanced]
ML & Data Science
Learn Python
Data Science Tutorial
Machine Learning Tutorial
Deep Learning Tutorial
NLP Tutorial
Computer Vision Tutorial
Web Development
HTML Tutorial
CSS Tutorial
JavaScript Tutorial
ReactJS Tutorial
NodeJS Tutorial
Languages
C
C++
Java
R Tutorial
Golang
Interview Corner
Company Interview Corner
Experienced Interviews
Internship Experiences
Practice Company Questions
Competitive Programming
CS Subjects
Operating Systems
DBMS
Computer Networks
Software Engineering
Software Testing
Jobs
Get Hired: Apply for Jobs
Job-a-thon: Hiring Challenge
Corporate Hiring Solutions
Practice
All DSA Problems
Problem of the Day
GFG SDE Sheet
Beginner's DSA Sheet
Love Babbar Sheet
Top 50 Array Problems
Top 50 String Problems
Top 50 DP Problems
Top 50 Graph Problems
Top 50 Tree Problems
Contests
World Cup Hack-A-Thon
GFG Weekly Coding Contest
Job-A-Thon: Hiring Challenge
BiWizard School Contest
All Contests and Events
GBlog
Puzzles
What's New ?
Change Language
Trending Now
Data Structures
Algorithms
Foundational Courses
Data Science
Practice Problem
Python
Machine Learning
JavaScript
Java
C
C++
ReactJS
NodeJS
Web Development
Web Design
Web Browser
CP Live
Aptitude
Puzzles
Projects
DSA
System Design
Software Development
Product Management
SAP
SEO
▲
Similar Topics
DSA
21k+ articles
Mathematical
7.6k+ articles
Searching
1.6k+ articles
Tree
1.3k+ articles
Recursion
980+ articles
Data Structures
800+ articles
DFS
350+ articles
Queue
340+ articles
Binary Tree
330+ articles
tree-level-order
120+ articles
Tree Traversals
110+ posts
Popular articles
Recent articles
Preorder Traversal of Binary Tree
Last Updated: 05 April 2023
Preorder traversal is defined as a type of tree traversal that follows the Root-Left-Right policy where:The root node of the subtree is visited first.Then the left subtree
...read more
Tree
Binary Tree
Tree Traversals
DSA
Postorder Traversal of Binary Tree
Last Updated: 23 March 2023
Postorder traversal is defined as a type of tree traversal which follows the Left-Right-Root policy such that for each node:The left subtree is traversed firstThen the rig
...read more
Tree
Binary Tree
Tree Traversals
DSA
Binary Search Tree (BST) Traversals – Inorder, Preorder, Post Order
Last Updated: 02 February 2023
Given a Binary Search Tree, The task is to print the elements in inorder, preorder, and postorder traversal of the Binary Search Tree.Input: Output:Inorder Traversal: 10 2
...read more
Binary Search Tree
Recursion
Tree Traversals
Picked
DSA
Similar Topics
DSA
21k+ articles
Mathematical
7.6k+ articles
Searching
1.6k+ articles
Tree
1.3k+ articles
Recursion
980+ articles
Data Structures
800+ articles
DFS
350+ articles
Queue
340+ articles
Binary Tree
330+ articles
tree-level-order
120+ articles
Binary Tree Iterator for Inorder Traversal
Last Updated: 20 February 2023
Given a Binary Tree and an input array. The task is to create an Iterator that utilizes next() and hasNext() functions to perform Inorder traversal on the binary tree.Exam
...read more
Tree
Inorder Traversal
Binary Tree
Algorithms
Tree Traversals
cpp-iterator
DSA
Height and Depth of a node in a Binary Tree
Last Updated: 25 September 2023
Given a Binary Tree consisting of N nodes and a integer K, the task is to find the depth and height of the node with value K in the Binary Tree.The depth of a node is the
...read more
Tree
Binary Tree
Height of a Tree
Searching
Recursion
Tree Traversals
DSA
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
Inorder Traversal
Preorder Traversal
PostOrder Traversal
Binary Tree
Stack
Tree Traversals
cpp-stack
DSA
Create a mirror tree from the given binary tree
Last Updated: 26 March 2023
Given a binary tree, the task is to create a new binary tree which is a mirror image of the given binary tree.Examples:Input: 5 / \ 3 6 / \ 2
...read more
Tree
Mirror Tree
Convert to Mirror
Binary Tree
Tree Traversals
DSA
Print path between any two nodes in a Binary Tree
Last Updated: 08 September 2022
Given a Binary Tree of distinct nodes and a pair of nodes. The task is to find and print the path between the two given nodes in the binary tree.For Example, in the above
...read more
Tree
Binary Tree
Tree Traversals
DSA
DFS traversal of a Tree
Last Updated: 30 May 2023
Given a Binary tree, Traverse it using DFS using recursion.Unlike linear data structures (Array, Linked List, Queues, Stacks, etc) which have only one logical way to trave
...read more
Tree
Inorder Traversal
Preorder Traversal
PostOrder Traversal
DFS
Tree Traversals
DSA
Preorder Traversal of N-ary Tree Without Recursion
Last Updated: 24 October 2022
Given an n-ary tree, print preorder traversal of it.Example :Preorder traversal of below tree is A B K N M J F D G E C H I LThe idea is to use stack like iterative preorde
...read more
Tree
Preorder Traversal
Tree Traversals
n-ary-tree
DSA
Preorder from Inorder and Postorder traversals
Last Updated: 18 January 2023
Given Inorder and Postorder traversals of a binary tree, print Preorder traversal.Example:Input: Postorder traversal post[] = {4, 5, 2, 6, 3, 1} Inorder traversal in
...read more
Tree
Stack
Hash
Tree Traversals
Java-HashMap
Java-Stack
DSA
Print nodes in top view of Binary Tree | Set 2
Last Updated: 13 April 2023
Top view of a binary tree is the set of nodes visible when the tree is viewed from the top. Given a binary tree, print the top view of it. The output nodes should be print
...read more
Tree
Binary Tree
Tree Traversals
Hash
cpp-map
tree-level-order
tree-view
DSA
Check if given Preorder, Inorder and Postorder traversals are of same tree
Last Updated: 06 October 2023
Given Preorder, Inorder, and Postorder traversals of some tree. Write a program to check if they all are of the same tree.Examples:Input : Inorder - 4 2 5 1 3 Preor
...read more
Tree
Binary Tree
Tree Traversals
DSA
Check if two nodes are cousins in a Binary Tree
Last Updated: 23 June 2022
Given the binary Tree and the two nodes say 'a' and 'b', determine whether the two nodes are cousins of each other or not.Two nodes are cousins of each other if they are a
...read more
Tree
Binary Tree
Amazon
Tree Traversals
DSA
Data Structures | Tree Traversals | Question 4
Last Updated: 28 June 2021
What does the following function do for a given binary tree?[sourcecode language="C"]int fun(struct node *root){ if (root == NULL) return 0; if (root-left == NULL
...read more
Data Structures
Data Structures
Data Structures-Tree Traversals
Tree Traversals
DSA
1
2
3
4
5
6
7
8
>>
Last
1
2
3
4
5
6
>>
Last
1
2
3
4
>>
Last
Courses
1089k+ interested Geeks
Data Structures and Algorithms - Self Paced
Explore
202k+ interested Geeks
Data Structures & Algorithms in Python - Self Paced
Explore
19k+ interested Geeks
Data Structures & Algorithms in JavaScript - Self Paced
Explore
Recently Published
Top 10 Full Stack Developer Frameworks
Read
Google launches new ‘Material You’ based Chrome Web Store
Read
10 Ways to Tackle Creative Block as a UX Designer
Read
How To Clear DNS Cache on Android Device?
Read
5 Best Chrome Alternatives for Android (2023)
Read
Top 10 Docker Alternatives For Software Developers
Read
What is DevOps?
Read
A Day in the Life of a Data Scientist
Read
How to Choose the Right Backend Technology?
Read
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 !