|
BRUtil - Making Java a Kinder, Gentler, Place to be. |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--brutil.PriorityQueueHeap
PriorityQueue.java Created: Wed Sep 25 16:04:47 2002
| Constructor Summary | |
PriorityQueueHeap()
|
|
| Method Summary | |
boolean |
decreaseKey(HandlePQ h,
int newKey)
Look at the (key, value) pair referenced by Handle h. |
HandlePQ |
extractMin()
Extract the (key, value) pair associated with the smallest key in the queue and return its "value" object. |
void |
heapify(int i)
Recusive method that maintains the heap property of the priority queue |
HandlePQ |
insert(int key,
java.lang.Object obj)
Insert a pair (key, obj) into the queue, and return a Handle to this pair so that we can find it later in constant time. |
boolean |
isEmpty()
Return true if there are no elements in the Priority Queue |
HandlePQ |
min()
Return the HandlePQ object with the smallest key in the queue. |
java.lang.String |
toString()
Returns all the elements in the PriorityQueue |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public PriorityQueueHeap()
| Method Detail |
public HandlePQ insert(int key,
java.lang.Object obj)
key - the key value of the objectobj - the object to be stored in the queuepublic void heapify(int i)
i - the index of the element to check the heap propertypublic HandlePQ extractMin()
public boolean decreaseKey(HandlePQ h,
int newKey)
h - the HandlePQ whose key value needs to be modifiednewKey - the new valuepublic HandlePQ min()
public boolean isEmpty()
public java.lang.String toString()
toString in class java.lang.Object
|
BRUtil - Making Java a Kinder, Gentler, Place to be. |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||