Disjoint-set find operation (source code)

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

The <disjoint-set find operation> returns the <disjoint-set representative> of a stored <set element> $x$. It preserves the <partition of a set>. With <path compression>, it can change internal pointers while answering the same membership question. Inputs outside the stored <set> require a specified error policy; they are not silently inserted here.