Skip to content

Glossary: Algorithms Beyond the Basics in JavaScript

Union-find

Also written: disjoint set union, disjoint set, DSU

A structure that keeps items in groups and answers "are these two in the same group?" almost instantly through `find` and `union`. Also called disjoint set union; Sam uses it to track which cafés are in the same delivery pool.

Where the book teaches it

Related terms

Path compressionUnion by sizeRoot (union-find)Connected component