representative ( a disjoint-set -- p )


Vocabulary
disjoint-sets

Inputs
aan object
disjoint-setan object


Outputs
pan object


Definition

GENERIC: representative ( a disjoint-set -- p )


Methods

M:: disjoint-set representative ( a disjoint-set -- p )
a disjoint-set parents>> at :> p a p =
[ a ] [
p disjoint-set representative
[ a disjoint-set set-parent ] keep
] if ;