|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectBinaryHeap
Binary heap implementation of a priority queue.
| Constructor Summary | |
BinaryHeap()
Constructs the binary heap. |
|
| Method Summary | |
void |
add(java.lang.Comparable item)
Adds and item to the heap. |
boolean |
isEmpty()
Tests if the heap is empty. |
java.lang.Comparable |
remove()
Removes an item of highest priority from the heap. |
int |
size()
Returns the current size of the queue |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BinaryHeap()
| Method Detail |
public boolean isEmpty()
isEmpty in interface PriorityQueuepublic int size()
size in interface PriorityQueuepublic void add(java.lang.Comparable item)
add in interface PriorityQueueitem - the item to add.public java.lang.Comparable remove()
remove in interface PriorityQueuejava.util.NoSuchElementException - if the heap is empty.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||