Data Structures

Disjoint Set Union

The Disjoint Set Union (DSU) data structure is used to maintain a collection of disjoint sets. It provides efficient operations for adding elements, finding the representative of a set, and merging two sets.

Usage

Example

Functions