Disjoint-set data structure: Difference between revisions

Content deleted Content added
Dcoetzee (talk | contribs)
+merge-find set, revise representative explanation
Bigaln2 (talk | contribs)
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