|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This is the interface for PriorityQueue.
This class was developed at the National Institute of Standards and Technology by employees of the Federal Government in the course of their official duties. Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public domain. NIST assumes no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic.
We would appreciate acknowledgement if the software is used.
NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
VERSION CONTROL
-------------------------------------------------------------------------
Name - YYYY/MM/DD - VERSION - ACTION
rouil - 2001/07/11 - 1.0 - Source created
rouil - 2002/01/29 - 1.1 - Changed package
| Nested Class Summary | |
static interface |
PriorityQueue.Position
The Position interface represents a type that can be used for the decreaseKey operation. |
| Method Summary | |
void |
decreaseKey(PriorityQueue.Position p,
java.lang.Comparable newVal)
Change the value of the item stored in the pairing heap. |
java.lang.Comparable |
deleteMin()
Remove the smallest item from the priority queue. |
java.lang.Comparable |
findMin()
Find the smallest item in the priority queue. |
PriorityQueue.Position |
insert(java.lang.Comparable x)
Insert into the priority queue, maintaining heap order. |
boolean |
isEmpty()
Test if the priority queue is logically empty. |
void |
makeEmpty()
Make the priority queue logically empty. |
int |
size()
Returns the size. |
| Method Detail |
public PriorityQueue.Position insert(java.lang.Comparable x)
x - the item to insert.
public java.lang.Comparable findMin()
UnderflowException - if empty.public java.lang.Comparable deleteMin()
UnderflowException - if empty.public boolean isEmpty()
public void makeEmpty()
public int size()
public void decreaseKey(PriorityQueue.Position p,
java.lang.Comparable newVal)
p - any non-null Position returned by insert.newVal - the new value, which must be smaller
than the currently stored value.
java.lang.IllegalArgumentException - if p invalid
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||