chickadee » disjoint-set » disjoint-set-find!

disjoint-set-find! ds xiprocedure

Finds the root element of the subset xi belongs to. Returns three values, ri, r, and ds, which are the index of the root, the root itself, and the mutated ds, respectively.

This procedure may mutate ds if it's not already at its optimal state.

It is an error if (> xi nelems), with nelems the number of elements of the Universe set of ds.