NODE
- public interface IHeap<NODE> extends Collection<NODE>
We also assume that heap will use Comparator
for comparing stored nodes.
Modifier and Type | Method and Description |
---|---|
boolean |
addAll(NODE[] items)
Adds all items from 'items'.
|
boolean |
changedKey(NODE node)
"node" value has been changed (not sure if it was increased or decreased), bubble it through the heap.
|
boolean |
containsAll(Object[] items)
Whether this heap contains all 'items'.
|
boolean |
decreaseKey(NODE node)
"node" value has been decreased, bubble it through the heap.
|
boolean |
deleteMin()
Deletes node with min-value, returns success (true if there was some object in the heap, false if there weren't).
|
boolean |
empty()
Whether this heap is empty.
|
Comparator<NODE> |
getComparator()
Returns comparator that is used to compare the nodes in the heap.
|
NODE |
getMin()
Returns node with min-value from the heap.
|
boolean |
increaseKey(NODE node)
"node" value has been increased, bubble it through the heap.
|
Set<NODE> |
toSet()
Returns this heap as a set.
|
Comparator<NODE> getComparator()
NODE getMin()
boolean deleteMin()
boolean decreaseKey(NODE node)
node
- boolean increaseKey(NODE node)
node
- boolean changedKey(NODE node)
node
- boolean addAll(NODE[] items)
items
- boolean containsAll(Object[] items)
items
- boolean empty()
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.