tidb: github.com/pingcap/tidb/util/disjointset Index | Files

package disjointset

import "github.com/pingcap/tidb/util/disjointset"


Package Files


type IntSet Uses

type IntSet struct {
    // contains filtered or unexported fields

IntSet is the int disjoint set.

func NewIntSet Uses

func NewIntSet(size int) *IntSet

NewIntSet returns a new int disjoint set.

func (*IntSet) FindRoot Uses

func (m *IntSet) FindRoot(a int) int

FindRoot finds the representative element of the set that `a` belongs to.

func (*IntSet) Union Uses

func (m *IntSet) Union(a int, b int)

Union unions two sets in int disjoint set.

Package disjointset is imported by 18 packages. Updated 2018-10-26. Refresh now. Tools for package owners.