public class ComparableMaxHeap<K extends Comparable<K>> extends ObjectHeap<K>
queue
DEFAULT_INITIAL_CAPACITY, modCount, size, validSize
Constructor and Description |
---|
ComparableMaxHeap()
Constructor with default capacity.
|
ComparableMaxHeap(int size)
Constructor with initial capacity.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
comp(Object o1,
Object o2)
Compare two objects
|
add, add, clear, ensureValid, heapifyDown, heapifyUp, peek, poll, removeAt, replaceTopElement, resize
desiredSize, heapModified, size
public ComparableMaxHeap()
public ComparableMaxHeap(int size)
size
- initial capacityprotected boolean comp(Object o1, Object o2)
comp
in class ObjectHeap<K extends Comparable<K>>
o1
- First objecto2
- Second object