Data StructuresUnion-Find

Union-Find

A data structure that tracks elements partitioned into disjoint sets.