|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrescuecore.tools.mapgenerator.PairHeap
| Constructor Summary | |
PairHeap()
Construct the pairing heap. |
|
| Method Summary | |
PairNode |
addItem(int val,
int priority)
Insert into the priority queue, and return a PairNode that can be used by decreaseKey. |
void |
decreaseKey(PairNode p,
int newPriority)
Change the value of the item stored in the pairing heap. |
int |
deleteMin()
Remove the smallest item from the priority queue. |
int |
findMin()
Find the highest priority value in the priority queue. |
PairNode |
insert(int val,
int priority)
Insert into the priority queue. |
boolean |
isEmpty()
Test if the priority queue is logically empty. |
static void |
main(java.lang.String[] args)
|
void |
makeEmpty()
Make the priority queue logically empty. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PairHeap()
| Method Detail |
public PairNode insert(int val,
int priority)
val - The value to insertpriority - The priority to give the value
public PairNode addItem(int val,
int priority)
val - the value to insert.priority - The priority to give the value
public int findMin()
public int deleteMin()
Underflow - if the priority queue is empty.
public void decreaseKey(PairNode p,
int newPriority)
p - any node returned by addItem.newPriority - - must decreasepublic boolean isEmpty()
public void makeEmpty()
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||