Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue[V any, P constraints.Ordered] struct { // contains filtered or unexported fields }
Queue represents a priority queue with MINIMUM priority.
func New ¶
func New[V any, P constraints.Ordered]() Queue[V, P]
New creates a new priority queue. Not required to call.
func (*Queue[V, P]) Peek ¶
func (pq *Queue[V, P]) Peek() V
Peek returns the minimum element of the priority queue without removing it.
func (*Queue[V, P]) PeekPriority ¶
func (pq *Queue[V, P]) PeekPriority() P
Peek returns the minimum element's priority.
func (*Queue[V, P]) Pop ¶
func (pq *Queue[V, P]) Pop() V
Pop removes and returns the minimum element of the priority queue.
Click to show internal directories.
Click to hide internal directories.