traversal

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2019 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TraversalBFS

func TraversalBFS(ele interface{}, filterFn func(ele interface{}, depth int) (gotoNextLayer bool), processFn func(ele interface{}, depth int) (gotoNextLayer bool))

TODO template in Go2.0 is expected Breadth First Search

func TraversalDFS

func TraversalDFS(ele interface{}, filterFn func(ele interface{}, depth int) (gotoNextLayer bool), processFn func(ele interface{}, depth int) (gotoNextLayer bool))

TODO template in Go2.0 is expected Depth First Search

func TraversalDLR

func TraversalDLR(ele interface{}, filterFn func(ele interface{}, depth int) (gotoNextLayer bool), processFn func(ele interface{}, depth int) (gotoNextLayer bool))

TODO template in Go2.0 is expected Preorder Traversal (DLR)

func TraversalLDR

func TraversalLDR(ele interface{}, filterFn func(ele interface{}, depth int) (gotoNextLayer bool), processFn func(ele interface{}, depth int) (gotoNextLayer bool))

TODO template in Go2.0 is expected Inorder Traversal (LDR)

func TraversalLRD

func TraversalLRD(ele interface{}, filterFn func(ele interface{}, depth int) (gotoNextLayer bool), processFn func(ele interface{}, depth int) (gotoNextLayer bool))

TODO template in Go2.0 is expected Postorder Traversal (LRD)

Types

type Lefter

type Lefter interface {
	// Left returns the left list element or nil.
	Left() interface{}
}

type Leftser

type Leftser interface {
	// Left returns the left list element or nil.
	Lefts() []interface{}
}

type Middleer

type Middleer interface {
	// Middle returns the middle list element or nil.
	Middle() interface{}
}

type Middleser

type Middleser interface {
	// Middle returns the middle list element or nil.
	Middles() []interface{}
}

type Node

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

A field represents a single Node found in a structure.

func (*Node) LeftNodes

func (n *Node) LeftNodes() []Node

func (*Node) Lefts

func (n *Node) Lefts() []interface{}

children

func (*Node) MiddleNodes

func (n *Node) MiddleNodes() []Node

func (*Node) Middles

func (n *Node) Middles() []interface{}

func (*Node) RightNodes

func (n *Node) RightNodes() []Node

func (*Node) Rights

func (n *Node) Rights() []interface{}

type Righter

type Righter interface {
	// Right returns the middle list element or nil.
	Right() interface{}
}

type Rightser

type Rightser interface {
	// Right returns the middle list element or nil.
	Rights() []interface{}
}

Jump to

Keyboard shortcuts

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