MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / UnionFind

Struct UnionFind

graph/unionfind.go:19–22  ·  view source on GitHub ↗

Defining the union-find data structure

Source from the content-addressed store, hash-verified

17
18// Defining the union-find data structure
19type UnionFind struct {
20 parent []int
21 rank []int
22}
23
24// Initialise a new union find data structure with s nodes
25func NewUnionFind(s int) UnionFind {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected