graph-toolkit
    Preparing search index...

    Class DisjointSet

    Union-find over 0..size-1 with union by rank and path compression, ~$O(\alpha(n))$ per op.

    Index
    • Merges the sets of left and right; returns false when already joined.

      Parameters

      • left: number
      • right: number

      Returns boolean