Lowest common ancestor of a binary search tree