Nearest common ancestor in b tree