trav

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DoFn

type DoFn[N Node] func(node N, info Info) error

type Info

type Info interface {
}

type InfoFn

type InfoFn[N Node] func(node N) (Info, error)

type NextFn

type NextFn[N Node] func(node N, info Info) ([]Pair[N], error)

type Node

type Node interface {
	IsNil() bool
}

type Pair

type Pair[N Node] struct {
	// contains filtered or unexported fields
}

func NewPair

func NewPair[N Node](node N, info Info, is_critical bool) Pair[N]

type TravFn

type TravFn[N Node] func(root N) error

type Traversor

type Traversor[N Node] struct {
	// contains filtered or unexported fields
}

func NewTraversor

func NewTraversor[N Node](do DoFn[N], next NextFn[N]) Traversor[N]

func (Traversor[N]) BFS

func (trav Traversor[N]) BFS() TravFn[N]

Breadth-First Search (BFS)

func (Traversor[N]) BFSWithInfo

func (trav Traversor[N]) BFSWithInfo(new_info InfoFn[N]) TravFn[N]

Breadth-First Search (BFS)

func (Traversor[N]) CFS

func (trav Traversor[N]) CFS() TravFn[N]

Children-First Search (CFS)

func (Traversor[N]) CFSWithInfo

func (trav Traversor[N]) CFSWithInfo(new_info InfoFn[N]) TravFn[N]

Children-First Search (CFS)

func (Traversor[N]) DFS

func (trav Traversor[N]) DFS() TravFn[N]

Depth-First Search (DFS)

func (Traversor[N]) DFSWithInfo

func (trav Traversor[N]) DFSWithInfo(new_info InfoFn[N]) TravFn[N]

Depth-First Search (DFS)

Jump to

Keyboard shortcuts

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