Std.DisjointSet
8 public declarations
- componentCount
&Std.DisjointSet.DisjointSet -> IntReturns the number of disconnected components remaining.
- componentSize
&Std.DisjointSet.DisjointSet -> Int -> Option[Int]Returns the number of elements in the component containing `x`.
- connected
&Std.DisjointSet.DisjointSet -> Int -> Int -> Option[Bool]Tests whether elements `x` and `y` belong to the same component.
- create
Int -> Std.DisjointSet.DisjointSetAllocates a disjoint-set forest of `totalElements` singleton components.
- DisjointSet
A low-level, flat-array Disjoint-Set (Union-Find) with path halving and union-by-rank.
- elementCount
&Std.DisjointSet.DisjointSet -> IntReturns the total number of elements tracked.
- find
&Std.DisjointSet.DisjointSet -> Int -> (Std.DisjointSet.DisjointSet, Option[Int])Finds the root representative of element `x` using iterative path halving.
- union
&Std.DisjointSet.DisjointSet -> Int -> Int -> Option[Std.DisjointSet.DisjointSet]Merges the sets containing elements `x` and `y` using union-by-rank.
