Lowest common ancestor in a binary search tree
Given a binary search tree and two distinct keys that are both in it, return their lowest common ancestor: the deepest node whose subtree contains both. A node's subtree includes the node itself. Use the tree's ordering rather than searching every node.
No answer yet. Write the first one; the best answer gets endorsed.
