Struct disjoint_set::DisjointSet [] [src]

pub struct DisjointSet<T: Clone> { /* fields omitted */ }

Tarjan's Union-Find Data structure

Methods

impl<T> DisjointSet<T> where
    T: Clone + Hash + Eq
[src]

Returns Some(num), num is the tag of subset in which x is. If x is not in the data structure, it returns None.

Union the subsets to which x and y belong. If it returns Ok, it is the tag for unified subset. it returns Err(), at least one of x and y is not in the disjoint-set.