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
DifficultyPatternProblemKey Insight
MediumboundsLC 98 ยท Validate Binary Search TreePropagate min/max bounds from ancestors; local child comparisons are not enough.
EasysearchLC 700 ยท Search in a Binary Search TreeEach comparison discards an entire subtree, so iterative search walks just one root-to-leaf path.
MediuminsertLC 701 ยท Insert into a Binary Search TreeFollow the search path to the null position and attach the new value as a leaf.
MediumdeleteLC 450 ยท Delete Node in a BSTHandle leaf, one-child, and two-child cases separately; use inorder successor for the third case.
MediuminorderLC 230 ยท Kth Smallest Element in a BSTInorder traversal visits BST values in ascending order, so stop on the kth visit.
MediumLCALC 235 ยท Lowest Common Ancestor of a BSTIf both targets are smaller go left, both larger go right; otherwise current node is the split point.

โ† Back to all LeetCode categories