Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PriorityQueue ¶
type PriorityQueue[V Value] struct { // contains filtered or unexported fields }
PriorityQueue is a priority queue implemented with max heap.
func NewPriorityQueue ¶
func NewPriorityQueue[V Value]() *PriorityQueue[V]
NewPriorityQueue creates an instance of NewPriorityQueue.
func (*PriorityQueue[V]) Len ¶
func (pq *PriorityQueue[V]) Len() int
Len is the number of elements in this PriorityQueue.
func (*PriorityQueue[V]) Peek ¶
func (pq *PriorityQueue[V]) Peek() V
Peek returns the maximum element from this PriorityQueue.
func (*PriorityQueue[V]) Pop ¶
func (pq *PriorityQueue[V]) Pop() V
Pop removes and returns the maximum element from this PriorityQueue.
func (*PriorityQueue[V]) Push ¶
func (pq *PriorityQueue[V]) Push(value V)
Push pushes the element x onto this PriorityQueue.
func (*PriorityQueue[V]) Release ¶
func (pq *PriorityQueue[V]) Release(value V)
Release deletes the given value from this PriorityQueue.
func (*PriorityQueue[V]) Values ¶
func (pq *PriorityQueue[V]) Values() []V
Values returns the values of this PriorityQueue.
Click to show internal directories.
Click to hide internal directories.