set

package
v0.0.0-...-e416b65 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2017 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DisjoinSet

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

DisjoinSet tracks and merges clusters. It might be useful for finding graph components and related problems. See http://en.wikipedia.org/wiki/Union_find for more details.

func NewDisjoinSet

func NewDisjoinSet() *DisjoinSet

NewDisjoinSet creates an empty DisjoinSet.

func (*DisjoinSet) Find

func (s *DisjoinSet) Find(x int) int

Find returns the root of cluster #x

func (*DisjoinSet) Join

func (s *DisjoinSet) Join(x, y int)

Join merges two clusters.

func (*DisjoinSet) Make

func (s *DisjoinSet) Make() int

Make makes the new cluster.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳