disjointset

package
v2.0.9+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2018 License: Apache-2.0 Imports: 0 Imported by: 252

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IntSet

type IntSet struct {
	// contains filtered or unexported fields
}

IntSet is the int disjoint set.

func NewIntSet

func NewIntSet(size int) *IntSet

NewIntSet returns a new int disjoint set.

func (*IntSet) FindRoot

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

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

func (*IntSet) Union

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

Union unions two sets in int disjoint set.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL