LeetCode ยท BST
Binary Search Tree Problem Set
BST-specific problems โ exploit ordering to search one path, traverse inorder for sorted output, and handle delete carefully with successor replacement.
Concept pages: BST ยท
Binary Tree
| Difficulty | Pattern | Problem | Key Insight |
|---|---|---|---|
| Medium | bounds | LC 98 ยท Validate Binary Search Tree | Propagate min/max bounds from ancestors; local child comparisons are not enough. |
| Easy | search | LC 700 ยท Search in a Binary Search Tree | Each comparison discards an entire subtree, so iterative search walks just one root-to-leaf path. |
| Medium | insert | LC 701 ยท Insert into a Binary Search Tree | Follow the search path to the null position and attach the new value as a leaf. |
| Medium | delete | LC 450 ยท Delete Node in a BST | Handle leaf, one-child, and two-child cases separately; use inorder successor for the third case. |
| Medium | inorder | LC 230 ยท Kth Smallest Element in a BST | Inorder traversal visits BST values in ascending order, so stop on the kth visit. |
| Medium | LCA | LC 235 ยท Lowest Common Ancestor of a BST | If both targets are smaller go left, both larger go right; otherwise current node is the split point. |