🎉 October Learning Month — learn a new software term every day!
An interactive flashcard trainer for software engineering terms.

Disjoint Set

In plain terms

A structure tracking elements partitioned into non-overlapping groups.

Going deeper

A disjoint-set (union-find) keeps items in separate groups and efficiently merges groups and checks membership. It's key for connectivity problems.

Under the hood

With path compression and union by rank, operations are near-constant (inverse-Ackermann) time.

Examples

Kruskal's MST, network connectivity, image segmentation, cycle detection.

Think of it like...

Like clubs that merge memberships, where you can instantly check if two people share a club.

Feedback & Bug Report