disjoint_union_set#
The Union-Find structure, also known as the Disjoint Set Union (DSU) structure, is an efficient data structure used to manage a partition of a set into disjoint (non-overlapping) subsets. It’s particularly useful in scenarios where we need to frequently determine whether two elements are in the same subset, and to unite two subsets into a single subset.
Classes
|
A Disjoint Set Union (DSU), also known as a Union-Find data structure, manages a partition of a set into disjoint (non-overlapping) subsets. |