Documentation
¶
Overview ¶
Package pqueue provides an implementation of priority queue derived from the work done by Robert Sedgewick and Kevin Wayne as part of Algorithms, 4th Edition.
http://algs4.cs.princeton.edu/code/
Copyright (C) 2000–2016 Robert Sedgewick and Kevin Wayne Copyright (C) 2017 Kasper Kronborg Isager
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PriorityQueue ¶
type PriorityQueue interface { // Size gets the current number of keys within the priority queue. Size() int // Push adds a key with a priority to the priority queue. Push(key int, priority float32) // Pop removes and returns the head of the priority queue. Pop() (int, error) // Peek returns the head of the priority queue. Peek() (int, error) // Priority returns the priority of a key in the priority queue. Priority(key int) (float32, error) // Update changes the priority of a key in the priority queue. Update(key int, priority float32) error // Remove removes a key from the priority queue. Remove(key int) error }
PriorityQueue describes a priority queue data structure used for ordering a set of keys according to their priority.