|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Heap interface, assume a comparator applies the heap order. The class includes several utilities fall into two categories 1. Methods to support the heap-to-array relationship and the corresponding index calculations 2. The code for the siftUp and siftDown methods
| Method Summary | |
void |
insert(java.lang.Object val)
Method insert a new object and reorganize the heap by applying the siftUp process. |
java.lang.Object |
remove()
Method removes the root and applies the heap siftDown process to maintain the heap correctly. |
int |
size()
Method size reports the current size of the heap. |
| Method Detail |
public int size()
public void insert(java.lang.Object val)
val - public java.lang.Object remove()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||