Discover Packages
github.com/haskelladdict/datastruct
pqueue
package
Version:
v0.0.0-...-e8a74ae
Opens a new window with list of versions in this module.
Published: Jun 28, 2014
License: BSD-3-Clause
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
type Item struct {
Val interface{}
Priority int
Index int
}
Item represents a single element of a Priority queue
type Pqueue priorityQueue
Pqueue implements a priority queue leveraging go's heap implementation
New creates a new priority queue initialized by items
Pop removes and returns the highest priority item of the queue
Push adds a new item to the priority queue.
func (pq *Pqueue ) Update(item *Item , Value interface{}, Priority int )
Update updates the Priority and Value of an item in the Priority queue
Source Files
¶
Click to show internal directories.
Click to hide internal directories.