|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectDataStructures.BinaryHeap<E>
E - the type of elements held in this heappublic class BinaryHeap<E extends java.lang.Comparable<? super E>>
Binary heap implementation of a priority queue.
StrictBinaryHeap| Constructor Summary | |
|---|---|
BinaryHeap()
Constructs an empty binary heap suitable for holding elements of type E. |
|
| Method Summary | |
|---|---|
void |
add(E item)
Adds an item to the heap. |
boolean |
isEmpty()
Tests if the heap is empty. |
E |
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 |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BinaryHeap()
| Method Detail |
|---|
public boolean isEmpty()
isEmpty in interface PriorityQueue<E extends java.lang.Comparable<? super E>>true if the queue is empty.public int size()
size in interface PriorityQueue<E extends java.lang.Comparable<? super E>>public void add(E item)
add in interface PriorityQueue<E extends java.lang.Comparable<? super E>>item - the item to be added.public E remove()
remove in interface PriorityQueue<E extends java.lang.Comparable<? super E>>
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||