Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item represents an item in the priority queue.
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
PriorityQueue implements a priority queue.
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
Len returns the length of the priority queue.
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
Less checks if the item at index i has higher priority than the item at index j.
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
Pop removes and returns the item with the highest priority from the priority queue.
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
Push adds an item to the priority queue.
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
Swap swaps the items at indexes i and j.
func (*PriorityQueue) Update ¶
func (pq *PriorityQueue) Update(item *Item, value interface{})
Update modifies the priority and value of an item in the priority queue.
Click to show internal directories.
Click to hide internal directories.