Generalize buildTree in paths-to-tree algorithm