unionfind

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UnionFind

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

Ref: https://en.wikipedia.org/wiki/Disjoint-set_data_structure

func New

func New(arr []int) *UnionFind

func (*UnionFind) Find

func (unif *UnionFind) Find(v int) int

func (*UnionFind) Size

func (unif *UnionFind) Size(x int) int

func (*UnionFind) Union

func (unif *UnionFind) Union(x, y int)

Jump to

Keyboard shortcuts

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