Binary Search Tree
Learn more about Binary Search Tree in DSA Self Paced Course
Practice Problems on Binary Search Tree !
What is Binary Search Tree?
Binary Search Tree is a node-based binary tree data structure which has the following properties:
- The left subtree of a node contains only nodes with keys lesser than the node’s key.
- The right subtree of a node contains only nodes with keys greater than the node’s key.
- The left and right subtree each must also be a binary search tree.

Binary Search Tree
Topic:
- Introduction to Binary Search Tree – Data Structure and Algorithm Tutorials
- Applications of BST
- Application, Advantages and Disadvantages of Binary Search Tree
- Insertion in Binary Search Tree
- Searching in Binary Search Tree
- Deletion in Binary Search Tree
- Binary Search Tree (BST) Traversals – Inorder, Preorder, Post Order
- Convert a normal BST to Balanced BST
-
Easy:
- Iterative searching in Binary Search Tree
- A program to check if a binary tree is BST or not
- Binary Tree to Binary Search Tree Conversion
- Find the node with minimum value in a Binary Search Tree
- Check if an array represents Inorder of Binary Search tree or not
- How to determine if a binary tree is height-balanced?
- Sorted Array to Balanced BST
- Check for Identical BSTs without building the trees
- Convert BST to Min Heap
- Second largest element in BST
- Add all greater values to every node in a given BST
- Check if two BSTs contain same set of elements
- Sum of k smallest elements in BST
-
Medium:
- Construct BST from given preorder traversal | Set 1
- Sorted Linked List to Balanced BST
- Transform a BST to greater sum tree
- BST to a Tree with sum of all smaller keys
- Construct BST from its given level order traversal
- Check if the given array can represent Level Order Traversal of Binary Search Tree
- Lowest Common Ancestor in a Binary Search Tree
- Find k-th smallest element in BST (Order Statistics in BST)
- K’th Largest element in BST using constant extra space
- Largest number in BST which is less than or equal to N
- Find distance between two nodes of a Binary Search Tree
- Largest BST in a Binary Tree | Set 2
- Remove all leaf nodes from the binary search tree
- Inorder Successor in Binary Search Tree
- Find a pair with given sum in BST
- Maximum element between two nodes of BST
- Find the largest BST subtree in a given Binary Tree
- Find a pair with given sum in a Balanced BST
- Two nodes of a BST are swapped, correct the BST
- How to handle duplicates in Binary Search Tree?
- Leaf nodes from Preorder of a Binary Search Tree (Using Recursion)
-
Hard:
- Construct all possible BSTs for keys 1 to N
- In-place Convert BST into a Min-Heap
- Check given array of size n can represent BST of n levels or not
- Merge two BSTs with limited extra space
- K’th Largest Element in BST when modification to BST is not allowed
- Check if given sorted sub-sequence exists in binary search tree
- Maximum Unique Element in every subarray of size K
- Count pairs from two BSTs whose sum is equal to a given value x
- Print BST keys in given Range | O(1) Space
- Inorder predecessor and successor for a given key in BST
- Find if there is a triplet in a Balanced BST that adds to zero
- Replace every element with the least greater element on its right
- Count inversions in an array | Set 2 (Using Self-Balancing BST)
- Leaf nodes from Preorder of a Binary Search Tree
- Minimum Possible value of |ai + aj – k| for given array and k.
- Special two digit numbers in a Binary Search Tree
- Merge Two Balanced Binary Search Trees
Recomended: