Binary tree, common ancestor, build tree