disjoint-sets: three union-find implementations
This library provides three disjoint set data structures:
UnionFind
: An array-based union-find where clients represent elements as small unsigned integers.UnionFindNode
: A tree-based union-find where each set can have associated ata, and where clients represent elements as opaque tree nodes.AUnionFind
: LikeUnionFind
, butSync
for sharing between threads.
All three perform rank-balanced path compression à la Tarjan, using interior mutability.
Usage
It’s on crates.io, so it can be
used by adding disjoint-sets
to the dependencies in your project’s
Cargo.toml
:
[]
= "*"