Content deleted Content added
m +of |
m →Disjoint-set forests: reword a bit |
||
Line 18:
== Disjoint-set forests ==
In a disjoint-set forest, each set is represented by a [[tree data structure]] where each node holds a [[reference]] to its parent node. The representative of each set is the root of that set's tree. '''Find''' simply follows parent nodes until it reaches the root. '''Union''' combines two trees into one by
{{wikicode}}
|