disjoint
Introduction
disjoint
is a package for the Go programming language that implements a disjoint-set data structure (also known as a union-find data structure). Disjoint sets are collections of unordered elements in which an element belongs to exactly one set at a time. Sets can be merged destructively, meaning that the the original sets cease to exist once their union is taken. And elements can be compared for belonging to the same set. These operations run in amortized near-constant time.
Installation
disjoint
is a Go module and therefore should be installed with
go get github.com/spakin/disjoint
and imported with
import "github.com/spakin/disjoint"
Usage
See the disjoint
API documentation for details and examples.
Author
Scott Pakin, scott+disj@pakin.org