Binary Search Tree Operations: Lowest Common Ancestor, Insertion, and Deletion
Lowest Common Ancestor in a BST (LeetCode 235)
Given a BST and two nodes p and q, find their lowest common ancestor (LCA). The BST property allows an efficient traversal from root down: the LCA is the first node whose value lies between p->val and q->val (inclusive). Because the tree is ordered, moving left/right narrows down the range un ...
Posted on Wed, 26 Aug 2026 16:29:53 +0000 by Bogart