UnionFind1

package
v0.0.0-...-adc727d Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: Apache-2.0 Imports: 0 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 struct {
	// contains filtered or unexported fields
}

我们的第一版Union-Find

func Constructor

func Constructor(size int) *UnionFind

func (*UnionFind) GetSize

func (this *UnionFind) GetSize() int

func (*UnionFind) IsConnected

func (this *UnionFind) IsConnected(p int, q int) bool

查看元素p和元素q是否所属一个集合 O(1)复杂度

func (*UnionFind) UnionElements

func (this *UnionFind) UnionElements(p int, q int)

合并元素p和元素q所属的集合 O(n) 复杂度

Jump to

Keyboard shortcuts

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