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]
Click to show internal directories.
Click to hide internal directories.