Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Prioritizer ¶
type Prioritizer interface {
Priority() int
}
Items in a PriorityQueue must implement the Priority interface.
type PriorityQueue ¶
type PriorityQueue[T Prioritizer] struct { // contains filtered or unexported fields }
PriorityQueue provides a priority queue based on container/heap.
An update method is missing because doing that requires access to the item to fix the heap after an item changes value.
func New ¶
func New[T Prioritizer]() *PriorityQueue[T]
func (*PriorityQueue[T]) Len ¶
func (q *PriorityQueue[T]) Len() int
func (*PriorityQueue[T]) Pop ¶
func (q *PriorityQueue[T]) Pop() T
func (*PriorityQueue[T]) Push ¶
func (q *PriorityQueue[T]) Push(t T)
Click to show internal directories.
Click to hide internal directories.