disjoint-sets 0.1.0

An implementation of Tarjan's Union-Find
Documentation

disjoint-sets: two union-find implementations

Build Status

This library provides two 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.

Both perform rank-balanced path compression à la Tarjan, using interior mutability.