Disjoint-set representative (source code)

= Disjoint-set representative
{title2=$\operatorname{find}(x)$}

A <disjoint-set representative> is a chosen member of a <block of a set partition>. It may be any member; it need not be the <minimum>, the first inserted member or a permanent identifier. A merge may change the <disjoint-set representative> of an existing member. At any one state, the required rule is
$$
\operatorname{find}(x)=\operatorname{find}(y)\quad\Longleftrightarrow\quad x,y\text{ belong to the same block}.
$$
If an application needs the <minimum> member, store it separately with the <disjoint-set representative> and update that extra information on merging.