#include <heap.h>
Public Member Functions | |
| heap (int s=DEFAULT_SIZE) | |
| ~heap () | |
| unsigned int | size () |
| void | add (graph_object *val) |
| Add object into heap. | |
| void | decreaseKey (graph_object *val) |
| Indicate that the key for a particular object has decreased. | |
| bool | isIn (graph_object *val) |
| Returns true if the object is in the heap. | |
| graph_object * | remove () |
| Remove the item with the lowest key from the heap & re-heapify. | |
| graph_object * | peek () |
| Return the item with the lowest key; don't remove it from the heap. | |
| bool | empty () |
| Returns true if no items are in the heap. | |
Private Member Functions | |
| void | heapifyUp (int index) |
| void | heapifyDown (int index) |
Private Attributes | |
| std::vector< graph_object * > | _elts |
| int | count |
|
|
|
|
|
|
|
|
Add object into heap.
|
|
|
Indicate that the key for a particular object has decreased.
|
|
|
Returns true if no items are in the heap.
|
|
|
|
|
|
|
|
|
Returns true if the object is in the heap.
|
|
|
Return the item with the lowest key; don't remove it from the heap.
|
|
|
Remove the item with the lowest key from the heap & re-heapify.
|
|
|
|
|
|
|
|
|
|
1.3.4