
public interface DoubleHeap
| Modifier and Type | Interface and Description | 
|---|---|
static interface  | 
DoubleHeap.UnsortedIter
Unsorted iterator - in heap order. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
add(double key)
Add a key-value pair to the heap 
 | 
void | 
add(double key,
   int max)
Add a key-value pair to the heap, except if the new element is larger than
 the top, and we are at design size (overflow) 
 | 
void | 
clear()
Delete all elements from the heap. 
 | 
boolean | 
isEmpty()
Is the heap empty? 
 | 
double | 
peek()
Get the current top key 
 | 
double | 
poll()
Remove the first element 
 | 
double | 
replaceTopElement(double e)
Combined operation that removes the top element, and inserts a new element
 instead. 
 | 
int | 
size()
Query the size 
 | 
DoubleHeap.UnsortedIter | 
unsortedIter()
Get an unsorted iterator to inspect the heap. 
 | 
void add(double key)
key - Keyvoid add(double key,
       int max)
key - Keymax - Maximum size of heapdouble replaceTopElement(double e)
e - New element to insertdouble peek()
double poll()
void clear()
int size()
boolean isEmpty()
true when the size is 0.DoubleHeap.UnsortedIter unsortedIter()