Go to the documentation of this file.
90 if (index == 0)
return;
91 int parent = (index-1)/2;
98 _elts[parent]->key = parent;
99 _elts[index]->key = index;
106 int child1 = index*2+1;
107 int child2 = index*2+2;
113 else if (child2 >=
count)
125 _elts[which]->key = which;
126 _elts[index]->key = index;
void HeapifyUp(int index)
std::vector< graph_object * > _elts
void DecreaseKey(graph_object *val)
Indicate that the key for a particular object has decreased.
Parent class for nodes and edges allowing them to be stored in a Heap or manipulated with other data ...
bool Empty()
Returns true if no items are in the Heap.
bool fless(double a, double b)
graph_object * Remove()
Remove the item with the lowest key from the Heap & re-heapify.
void HeapifyDown(int index)
bool fgreater(double a, double b)
void Add(graph_object *val)
Add object into Heap.
bool IsIn(graph_object *val)
Returns true if the object is in the Heap.