union_find

package
v0.0.0-...-8859e38 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2018 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UF

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

UF data type models connectivity among a set of n sites. This implementation uses weighted quick union by rank with path compression by halving during find operation.

func NewUnionFind

func NewUnionFind(n int) *UF

func (*UF) Connected

func (uf *UF) Connected(p, q int) bool

func (*UF) Count

func (uf *UF) Count() int

func (*UF) Find

func (uf *UF) Find(p int) int

func (*UF) Union

func (uf *UF) Union(p, q int)

Jump to

Keyboard shortcuts

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