next up previous
Next: Up: Previous:

Operations

x = pointer to an object containing some key

Make-Set(x)
$\;\;\;\;\;$Create new set Sx with one member x
$\;\;\;\;\;$Representative of Sx is x
$\;\;\;\;\;$Disjoint set = Disjoint set + Sx



Union(x,y)
$\;\;\;\;\;$Sx = set containing x
$\;\;\;\;\;$Sy = set containing y
$\;\;\;\;\;$ $S_u = S_x \cup S_y$
$\;\;\;\;\;$rep(Su) = rep(Sx) or rep(Sy) $\;\;\;\;\;$ $\;\;\;\;\;$; or any other object in Su
$\;\;\;\;\;$Disjoint set = Disjoint set - Sx - Sy + Su



Find-Set(x)
$\;\;\;\;\;$Sx = set containing x
$\;\;\;\;\;$return rep(Sx)


next up previous
Next: Up: Previous: