Least You Need to Know: Union-Find for Connectivity and Cycles
Open lesson
Union-find, also called disjoint set union (DSU), tracks which items currently belong to the same connected component. It is especially useful when edges are added over time and you need fast connectivity or redundant-edge reasoning.