|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- the type of data the heap stores.public interface Heap<T extends java.lang.Comparable<? super T>>
An interface for the Max-Heap ADT. Note that the ordering of elements is determined with the T.compareTo() method.
Method Summary | |
---|---|
void |
add(T item)
Adds the given item to the heap. |
void |
clear()
Removes all items from the heap. |
boolean |
isEmpty()
Returns true if the heap is empty. |
T |
peek()
Returns the maximum value, but doesn't change the heap. |
T |
removeRoot()
Removes and returns the maximum value in the heap. |
Method Detail |
---|
void add(T item)
T removeRoot()
T peek()
boolean isEmpty()
void clear()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |