Content deleted Content added
+merge-find set, revise representative explanation |
|||
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
|