unionfind

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: BSD-3-Clause Imports: 1 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[T comparable] interface {
	// Union two clusters
	Union(T, T)

	// Find the cluster of value, if it does not belong to any
	// create one
	Find(T) T

	// Cluster size
	Size(T) int

	// Number of clusters
	Count() int
}

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

func NewUnionFind added in v1.1.0

func NewUnionFind[T comparable](input []T) UnionFind[T]

Jump to

Keyboard shortcuts

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