simple

package
v0.0.0-...-e19c9e5 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bfs

func Bfs(bt *BinaryTree) []interface{}

func Dfs

func Dfs(bt *BinaryTree) []interface{}

Dfs probably a mistake

func MidOrderVisit

func MidOrderVisit(bt *BinaryTree)

func PostOrderVisit

func PostOrderVisit(bt *BinaryTree)

func PreOrderVisit

func PreOrderVisit(bt *BinaryTree)

func TraversalList

func TraversalList(head *LinkedList)

Types

type Array

type Array struct {
	Slice  []int
	SI, EI int
}

Array TODO

func (*Array) Construct

func (array *Array) Construct()

type BinSequence

type BinSequence []interface{}

type BinaryTree

type BinaryTree struct {
	Left, Right *BinaryTree
	Value       interface{}
}

type LinkedList

type LinkedList struct {
	NodeData interface{}
	NextNode *LinkedList
}

func Del

func Del(data interface{}, head *LinkedList) *LinkedList

func Ins

func Ins(data interface{}, head *LinkedList) *LinkedList

func Rev

func Rev(head *LinkedList) *LinkedList

type MyHeap

type MyHeap struct {
	sort.IntSlice
	// contains filtered or unexported fields
}

func (*MyHeap) IsEmpty

func (heap *MyHeap) IsEmpty() bool

func (*MyHeap) Less

func (heap *MyHeap) Less(i, j int) bool

func (*MyHeap) Pop

func (heap *MyHeap) Pop() error

func (*MyHeap) Push

func (heap *MyHeap) Push(value interface{})

func (*MyHeap) Top

func (heap *MyHeap) Top() (interface{}, error)

type MyQueue

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

func (*MyQueue) Back

func (q *MyQueue) Back() (interface{}, error)

func (*MyQueue) Front

func (q *MyQueue) Front() (interface{}, error)

func (*MyQueue) IsEmpty

func (q *MyQueue) IsEmpty() bool

func (*MyQueue) Pop

func (q *MyQueue) Pop() error

func (*MyQueue) Push

func (q *MyQueue) Push(value interface{})

func (*MyQueue) Traverse

func (q *MyQueue) Traverse()

type MyStack

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

func (*MyStack) IsEmpty

func (s *MyStack) IsEmpty() bool

func (*MyStack) Pop

func (s *MyStack) Pop() error

func (*MyStack) Push

func (s *MyStack) Push(value interface{})

func (*MyStack) Top

func (s *MyStack) Top() (interface{}, error)

Jump to

Keyboard shortcuts

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