Devise an algorithm for constructing a rooted tree from the universal addresses of its leaves. A cut set of a graph is a set of edges such that the removal of these edges produces a subgraph with more connected components than in the original graph, but no proper subset of this set of edges has this property.