Interesting Problems on Binary Trees
Binary Trees
A good set of 25 interesting problems that touch various aspects of Binary Trees. Solving these should definitely increase your confidence on B trees.
Binary Search Trees
- Lowest Common Ancestor in a Binary tree
- Distance between two nodes in a tree
- Reverse level order traversal
- Print left/right/top view of binary tree
- Check if a binary tree is complete or not
- Check if a binary tree is balanced or not
- Diameter of a given binary tree
- Determine if a given binary tree is sub tree or not
- Print common nodes on path from root (or common ancestors)
- Inorder successor of a given node in Binary tree/ Successor of all nodes ?
- Print root to leaf paths in a binary tree one per line
- Boundary traversal of Binary Tree
- Construct Tree from Inorder and Preorder/Postorder
- Construct Tree from Inorder and Level order ?
- Construct a binary tree from Linked list
- Convert a binary tree to Double linked list
- Convert a binary tree to its mirror tree / Check if two trees are mirror
- Convert a given tree to its sum tree / Check if a given BT is sum tree or not ?
- Change a binary tree so that every node stores sum of all nodes in left subtree
- Connect nodes at same level / Find next node in same level of BT
- Serialize and Deserialize a binary tree
- Diagonal sum of a binary tree
- Print nodes at K distance from root in binary tree
- Iterative Inorder/Preorder/Postorder
- Convert ternary expression to a Binary Tree
- Insertion In BST
- Search a given key in BST
- Delete a key in BST
- Determine if a given Binary tree is BST or not
- Find LCA in BST
- Find kth smallest or kth largest in BST
- Floor and Ceil in a BST
- Convert Binary Tree to BST ?
- Convert sorted array to Balanced BST
- Cost to construct a BST
Comments
Post a Comment