Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item[T any] struct { // The Value of the item; arbitrary. Value T // The Priority of the item in the queue. Priority int64 // contains filtered or unexported fields }
Item for generic support
type PriorityQueue ¶
type PriorityQueue[T any] struct { // contains filtered or unexported fields }
func NewPriorityQueue ¶
func NewPriorityQueue[T any](items []Item[T]) *PriorityQueue[T]
func (*PriorityQueue[T]) Peek ¶
func (h *PriorityQueue[T]) Peek() Item[T]
func (*PriorityQueue[T]) Pop ¶
func (h *PriorityQueue[T]) Pop() Item[T]
func (*PriorityQueue[T]) Push ¶
func (h *PriorityQueue[T]) Push(x Item[T])
func (*PriorityQueue[T]) Range ¶
func (h *PriorityQueue[T]) Range() []Item[T]
func (*PriorityQueue[T]) Update ¶
func (h *PriorityQueue[T]) Update(item Item[T], value T, priority int64)
Click to show internal directories.
Click to hide internal directories.