35 Problems
Binary Trees
Master binary trees problems with detailed brute force and optimal solutions.
01
Level order traversal
Click to view brute force and optimal solutions
02
Reverse Level Order traversal
Click to view brute force and optimal solutions
03
Height of a tree
Click to view brute force and optimal solutions
04
Diameter of a tree
Click to view brute force and optimal solutions
05
Mirror of a tree
Click to view brute force and optimal solutions
06
Inorder Traversal of a tree both using recursion and Iteration
Click to view brute force and optimal solutions
07
Preorder Traversal of a tree both using recursion and Iteration
Click to view brute force and optimal solutions
08
Postorder Traversal of a tree both using recursion and Iteration
Click to view brute force and optimal solutions
09
Left View of a tree
Click to view brute force and optimal solutions
10
Right View of Tree
Click to view brute force and optimal solutions
11
Top View of a tree
Click to view brute force and optimal solutions
12
Bottom View of a tree
Click to view brute force and optimal solutions
13
Zig-Zag traversal of a binary tree
Click to view brute force and optimal solutions
14
Check if a tree is balanced or not
Click to view brute force and optimal solutions
15
Diagonal Traversal of a Binary tree
Click to view brute force and optimal solutions
16
Boundary traversal of a Binary tree
Click to view brute force and optimal solutions
17
Construct Binary Tree from String with Bracket Representation
Click to view brute force and optimal solutions
18
Convert Binary tree into Doubly Linked List
Click to view brute force and optimal solutions
19
Convert Binary tree into Sum tree
Click to view brute force and optimal solutions
20
Construct Binary tree from Inorder and preorder traversal
Click to view brute force and optimal solutions
21
Find minimum swaps required to convert a Binary tree into BST
Click to view brute force and optimal solutions
22
Check if Binary tree is Sum tree or not
Click to view brute force and optimal solutions
23
Check if all leaf nodes are at same level or not
Click to view brute force and optimal solutions
24
Check if a Binary Tree contains duplicate subtrees of size 2 or more [IMP]
Click to view brute force and optimal solutions
IMP
25
Check if 2 trees are mirror or not
Click to view brute force and optimal solutions
26
Sum of Nodes on the Longest path from root to leaf node
Click to view brute force and optimal solutions
27
Check if given graph is tree or not [IMP]
Click to view brute force and optimal solutions
IMP
28
Find Largest subtree sum in a tree
Click to view brute force and optimal solutions
29
Maximum Sum of nodes in Binary tree such that no two are adjacent
Click to view brute force and optimal solutions
30
Print all K Sum paths in a Binary tree
Click to view brute force and optimal solutions
31
Find LCA in a Binary tree
Click to view brute force and optimal solutions
32
Find distance between 2 nodes in a Binary tree
Click to view brute force and optimal solutions
33
Kth Ancestor of node in a Binary tree
Click to view brute force and optimal solutions
34
Find all Duplicate subtrees in a Binary tree [IMP]
Click to view brute force and optimal solutions
IMP
35
Tree Isomorphism Problem
Click to view brute force and optimal solutions