Struct disjoint_sets::AUnionFind
[−]
[src]
pub struct AUnionFind { // some fields omitted }
Concurrent union-find representing a set of disjoint sets.
Warning
I don’t yet have good reason to believe that this is correct.
Methods
impl AUnionFind
[src]
fn new(size: usize) -> Self
Creates a new asynchronous union-find of size
elements.
fn len(&self) -> usize
The number of elements in all the sets.
fn union(&self, a: usize, b: usize)
Joins the sets of the two given elements.
fn find(&self, element: usize) -> usize
Finds the representative element for the given element’s set.
fn equiv(&self, a: usize, b: usize) -> bool
Determines whether two elements are in the same set.
fn force(&self)
Forces all laziness, so that each element points directly to its set’s representative.
fn as_vec(&self) -> Vec<usize>
Returns a vector of set representatives.