Documentation ¶
Overview ¶
Package pqueue provides a priority queue implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PriorityQueue ¶
type PriorityQueue []*Item
PriorityQueue as implemented by a min heap ie. the 0th element is the *lowest* value.
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
Less returns true if the item at index i has a lower priority than the item at index j.
func (*PriorityQueue) PeekAndShift ¶
func (pq *PriorityQueue) PeekAndShift(max int64) (*Item, int64)
PeekAndShift based the max priority.
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
Push a new value to the queue.
Click to show internal directories.
Click to hide internal directories.