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