Disjoint set union

Problems on disjoint set union, including merging groups and answering whether two elements are connected, counting components as edges are added, Kruskal's minimum spanning tree, processing deletions offline in reverse, and keeping extra data such as sizes or parity per set.

The disjoint set union article in the Data structures section explains the structure, and Kruskal's algorithm shows its best-known use. Related problem sets are under Graphs and Trees.

Problems