K - the type of keys maintained by this heappublic interface Heap<K>
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear all the elements of this heap.
|
Comparator<? super K> |
comparator()
Returns the comparator used to order the keys in this heap, or
null if this heap uses the natural
ordering of its keys. |
K |
deleteMin()
Delete and return an element with the minimum key.
|
K |
findMin()
Find an element with the minimum key.
|
void |
insert(K key)
Insert a key into the heap.
|
boolean |
isEmpty()
Returns
true if this heap is empty. |
long |
size()
Returns the number of elements in this heap.
|
Comparator<? super K> comparator()
null if this heap uses the natural
ordering of its keys.null if this heap uses the natural ordering of its keysvoid insert(K key)
key - the key to insertK findMin()
NoSuchElementException - if the heap is emptyK deleteMin()
NoSuchElementException - if the heap is emptyboolean isEmpty()
true if this heap is empty.true if this heap is empty, false otherwiselong size()
void clear()
Copyright © 2018. All rights reserved.