Content deleted Content added
→Disjoint-set forests: bold |
→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
|