Documentation
¶
Index ¶
- type Item
- type PriorityQueue
- func (pq PriorityQueue) Len() int
- func (pq PriorityQueue) Less(i, j int) bool
- func (pq *PriorityQueue) Pop() interface{}
- func (pq *PriorityQueue) PrintQueue()
- func (pq *PriorityQueue) Push(x interface{})
- func (pq *PriorityQueue) SetNodeValue(item *Item, value interface{})
- func (pq PriorityQueue) Swap(i, j int)
- func (pq *PriorityQueue) Update(item *Item, value interface{}, priority int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct { Index int // The index of the item in the heap. // contains filtered or unexported fields }
An Item is something we manage in a priority queue.
func (*Item) GetPriority ¶
func (*Item) SetPriority ¶
type PriorityQueue ¶
type PriorityQueue []*Item
A PriorityQueue implements heap.Interface and holds Items.
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
func (*PriorityQueue) PrintQueue ¶
func (pq *PriorityQueue) PrintQueue()
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
func (*PriorityQueue) SetNodeValue ¶
func (pq *PriorityQueue) SetNodeValue(item *Item, value interface{})
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
func (*PriorityQueue) Update ¶
func (pq *PriorityQueue) Update(item *Item, value interface{}, priority int)
update modifies the priority and value of an Item in the queue.
Click to show internal directories.
Click to hide internal directories.