LCA in BST
If both values are less than the current node, go left.
If both values are greater, go right.
Otherwise the current node is the LCA.
Time complexity: O(h).
Iterative implementation uses O(1) auxiliary space.
Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.