pqueue

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iterator

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

func NewIterator

func NewIterator(n *Node) *Iterator

func NewIteratorWithCap

func NewIteratorWithCap(n *Node, cap int) *Iterator

func (*Iterator) GetNext

func (iter *Iterator) GetNext(cur *Node, idx int) *Node

func (*Iterator) GetNode

func (iter *Iterator) GetNode() *Node

func (*Iterator) GetPrev

func (iter *Iterator) GetPrev(cur *Node, idx int) *Node

func (*Iterator) Next

func (iter *Iterator) Next() (result bool)

func (*Iterator) Prev

func (iter *Iterator) Prev() (result bool)

func (*Iterator) SetNode

func (iter *Iterator) SetNode(n *Node)

func (*Iterator) ToHead

func (iter *Iterator) ToHead()

func (*Iterator) ToTail

func (iter *Iterator) ToTail()

func (*Iterator) Value

func (iter *Iterator) Value() interface{}

type Node

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

func (*Node) String

func (n *Node) String() string

type PriorityQueue

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

func New

func New(Compare compare.Compare) *PriorityQueue

func (*PriorityQueue) Get

func (pq *PriorityQueue) Get(value interface{}) (interface{}, bool)

func (*PriorityQueue) GetAround

func (pq *PriorityQueue) GetAround(value interface{}) [3]interface{}

func (*PriorityQueue) GetAroundNode

func (pq *PriorityQueue) GetAroundNode(value interface{}) [3]*Node

func (*PriorityQueue) GetNode

func (pq *PriorityQueue) GetNode(value interface{}) (*Node, bool)

func (*PriorityQueue) GetRange

func (pq *PriorityQueue) GetRange(k1, k2 interface{}) []interface{}

func (*PriorityQueue) Index

func (pq *PriorityQueue) Index(idx int) (interface{}, bool)

func (*PriorityQueue) IndexNode

func (pq *PriorityQueue) IndexNode(idx int) (*Node, bool)

func (*PriorityQueue) Iterator

func (pq *PriorityQueue) Iterator() *Iterator

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() (result interface{}, ok bool)

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(value interface{})

func (*PriorityQueue) Remove

func (pq *PriorityQueue) Remove(vlaue interface{}) (interface{}, bool)

func (*PriorityQueue) RemoveIndex

func (pq *PriorityQueue) RemoveIndex(idx int) (interface{}, bool)

func (*PriorityQueue) RemoveNode added in v0.7.2

func (pq *PriorityQueue) RemoveNode(node *Node)

func (*PriorityQueue) Size

func (pq *PriorityQueue) Size() int

func (*PriorityQueue) String

func (pq *PriorityQueue) String() string

func (*PriorityQueue) Top

func (pq *PriorityQueue) Top() (result interface{}, ok bool)

func (*PriorityQueue) Values

func (pq *PriorityQueue) Values() []interface{}

type TraversalMethod

type TraversalMethod int
const (

	//DLR 先值 然后左递归 右递归 下面同理
	DLR TraversalMethod
	//LDR 先从左边有序访问到右边 从小到大
	LDR
	// LRD 同理
	LRD

	// DRL 同理
	DRL

	// RDL 先从右边有序访问到左边 从大到小
	RDL

	// RLD 同理
	RLD
)

Jump to

Keyboard shortcuts

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