Content deleted Content added
Added disjoint-set forests |
m Rename section |
||
Line 6:
While we could represent the sets themselves as objects and have the operations operate on these sets, the more common approach is to choose an element from each set as a ''representative''; then, '''Find''' returns the representative of the set that the given element is in, and '''Union''' takes the representatives of two given sets.
==
Perhaps the simplest approach to creating a disjoint-set data structure is to create a [[linked list]] for each group. We choose the element at the head of the list as the representative.
|