Disjoint-set data structure: Difference between revisions

Content deleted Content added
Dcoetzee (talk | contribs)
Dcoetzee (talk | contribs)
Disjoint-set forests: comments in Find code
Line 54:
'''function''' Find(x)
p := x
'''while''' p.parent ≠ '''null''' ''// Find root
p := p.parent
root := p
p := x
'''while''' p ≠ root ''// Update parents
next := p.parent
p.parent := root