pub struct Forests<T> where
    T: Eq + Hash
{ /* private fields */ }
Expand description

Data structure for building disjoint sets

Implementations

Counts the number of unique disjoint sets.

Groups items by their containing sets. The result is the indices of items in the provided items that belongs to different disjoint sets. The order of groups is arbitrary. Items that do not exist in the forest belongs to the same group that does not consist of other contained items.

Makes a new singleton set with exactly one element item.

Find the label of the set item belongs to.

Unions the two sets containing item1 and item2. No-op if either item1 or item2 is not present (i.e. no make_set has been made).

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.