Documentation
¶
Overview ¶
Package queue provided a generic priority queue implantation based on the internal heap
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
PriorityQueue implemented using a heap
func NewPriorityQueue ¶
func NewPriorityQueue(cmpFunc func(interface{}, interface{}) bool) *PriorityQueue
NewPriorityQueue creates a new heap based PriorityQueue using cmpFunc as the comparison function
func (*PriorityQueue) Len ¶
func (pq *PriorityQueue) Len() int
Len returns the number of items in the queue
func (*PriorityQueue) Peek ¶
func (pq *PriorityQueue) Peek() interface{}
Peek returns the next item in the queue without removing it
func (*PriorityQueue) PeekUpdate ¶
func (pq *PriorityQueue) PeekUpdate()
PeekUpdate reorders the backing heap with the new values
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
Pop removes and returns the next item in the queue
func (*PriorityQueue) Print ¶
func (pq *PriorityQueue) Print()
Print prints the current ordered queue
Click to show internal directories.
Click to hide internal directories.