Documentation ¶
Overview ¶
Package queues provides queue data structures.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PriorityQueue ¶
type PriorityQueue interface { // Add adds the specified item to the priority queue. // Priority is a integer that represents the specified item's relative // priority: the bigger, the higher. Add(item interface{}, priority int) // Poll removes the lowest-priority item from the queue and returns it. Poll() (interface{}, bool) // Len is the number of items in the queue. Len() int }
PriorityQueue represents a priority queue. This type is NOT thread-safe!
func NewPriorityQueue ¶
func NewPriorityQueue(initialCapacity int) PriorityQueue
NewPriorityQueue creates a new instance of PriorityQueue.
Click to show internal directories.
Click to hide internal directories.