Documentation ¶
Overview ¶
package pq implements a priority queue.
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 holds values. Values are auto orderd by their priorities.
func (*PriorityQueue) Pop ¶
func (p *PriorityQueue) Pop() interface{}
Pop pops out value with minimal priority. It returns nil if no value exists.
func (*PriorityQueue) Priority ¶
func (p *PriorityQueue) Priority(value interface{}) (priority int64, ok bool)
Priority retrieves values's priority.
func (*PriorityQueue) Push ¶
func (p *PriorityQueue) Push(value interface{}, priority int64)
Push add a value with priority to queue.
func (*PriorityQueue) Remove ¶
func (p *PriorityQueue) Remove(value interface{})
Remove removes the provided value from queue.
Click to show internal directories.
Click to hide internal directories.