Packages

p

algo.data.dsu

mutable

package mutable

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. trait DisjointSetUnion[V] extends IterableOnce[V]

    Disjoint-Set Data Structure (a.k.a.

    Disjoint-Set Data Structure (a.k.a. Union-Find)

    Manages a collection of disjoint sets. Each set contains no duplicate members. Like an array, an index identifies each member.

    Provides some operations on almost constant time:

    • Determines whether the two members are in the same group
    • Finds a value of the representative member of the group containing the given members
    • Merges two sets into a single group containing the given members

    If two sets are merged into a new single set, the representative member's value of the new set is calculated from the representative members' values of the two sets to merge. For this calculation, cats.kernel.CommutativeSemigroup must be available.

    Expects that the semigroup-combine calculation will complete in a constant time, but not required. Suppose the calculation completes in O(K). The time complexity of almost operation are multiplied by such time O(K).

    V

    Type of the members in the sets

Ungrouped