In a BST, if both targets are smaller, LCA is in left subtree; if both larger, in right subtree.
Iteratively walk from root:
p and q are both < current, go left.BST ordering guarantees the first node where paths to p and q diverge is the lowest common ancestor.
In a BST, if both targets are smaller, LCA is in left subtree; if both larger, in right subtree.
Iteratively walk from root:
p and q are both < current, go left.BST ordering guarantees the first node where paths to p and q diverge is the lowest common ancestor.