Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaxQueueFunc ¶
func MinQueueFunc ¶
Types ¶
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
An Element is what's held by the priority queue
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
func New ¶
func New(typ PriorityQueueType) *PriorityQueue
func (*PriorityQueue) Len ¶
func (pq *PriorityQueue) Len() int
Len returns the number of elements in the queue
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() (interface{}, int, error)
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(value interface{}, priority int)
func (*PriorityQueue) Top ¶
func (pq *PriorityQueue) Top() (interface{}, int, error)
type PriorityQueueType ¶
type PriorityQueueType uint8
const ( MinQueue PriorityQueueType = iota + 1 //Configures the queue to return the smallest element on pop MaxQueue PriorityQueueType = iota + 1 //Configures the queue to return the largest element on pop )
func (PriorityQueueType) String ¶
func (i PriorityQueueType) String() string
Click to show internal directories.
Click to hide internal directories.