algo

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayUnion

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

func (*ArrayUnion) Copy

func (au *ArrayUnion) Copy() *ArrayUnion

func (*ArrayUnion) Get

func (au *ArrayUnion) Get(i int) int

func (*ArrayUnion) GetRoot

func (au *ArrayUnion) GetRoot(i int) int

func (*ArrayUnion) Init

func (au *ArrayUnion) Init(l int) *ArrayUnion

func (*ArrayUnion) Merge

func (au *ArrayUnion) Merge(i, j int) bool

func (*ArrayUnion) NumGroup

func (au *ArrayUnion) NumGroup() int

func (*ArrayUnion) Reset

func (au *ArrayUnion) Reset()

func (*ArrayUnion) Set

func (au *ArrayUnion) Set(i, v int)

type GraphEdge

type GraphEdge[V any, W common.Number] struct {
	VertexU *V
	VertexV *V
	Weight  W
}

type Trie

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

func (*Trie) Add

func (t *Trie) Add(word string)

func (*Trie) Init

func (t *Trie) Init(nChild int, charToIndex func(byte) int) *Trie

func (*Trie) Search

func (t *Trie) Search(word string) bool

func (*Trie) StartsWith

func (t *Trie) StartsWith(prefix string) bool

type TrieNode

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

type UndirectedGraph

type UndirectedGraph[V any, W common.Number] struct {
	// contains filtered or unexported fields
}

func (*UndirectedGraph[V, W]) ContainsVertex

func (g *UndirectedGraph[V, W]) ContainsVertex(u *V) bool

func (*UndirectedGraph[V, W]) Edges

func (g *UndirectedGraph[V, W]) Edges() []GraphEdge[V, W]

func (*UndirectedGraph[V, W]) Init

func (g *UndirectedGraph[V, W]) Init(vertexes []*V, edges []GraphEdge[V, W]) *UndirectedGraph[V, W]

func (*UndirectedGraph[V, W]) MinimumPathWeightSumsByDijkstra

func (g *UndirectedGraph[V, W]) MinimumPathWeightSumsByDijkstra(src *V) map[*V]W

func (*UndirectedGraph[V, W]) MinimumSpanningTreeEdgesByKruskal

func (g *UndirectedGraph[V, W]) MinimumSpanningTreeEdgesByKruskal() ([]GraphEdge[V, W], bool)

func (*UndirectedGraph[V, W]) Vertexes

func (g *UndirectedGraph[V, W]) Vertexes() []*V

Jump to

Keyboard shortcuts

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