36 PQueue(CompareFunc compare, DestroyFunc destroyValue,
Vector* values);
65 void insert(Pointer value);
86 void remove(Pointer value, CompareFunc compare);
94 int find(Pointer value, CompareFunc compare);
106 Pointer nodeValue(
int nodeId);
107 void nodeSwap(
int nodeId1,
int nodeId2);
108 void bubbleUp(
int nodeId);
109 void bubbleDown(
int nodeId);
110 void naiveHeapify(
Vector* values);
115 DestroyFunc destroyValue;
ADTVector implementation using a dynamic array.
ADT Priority Queue.
Definition ADTPQueue.hpp:19
void insert(Pointer value)
Insert a new element to the queue.
Definition ADTPQueue.cpp:112
Pointer getMin()
Get the min element of the queue.
Definition ADTPQueue.cpp:99
Vector * toVector()
Returns all the elements as a vector.
Definition ADTPQueue.hpp:101
void remove(Pointer value, CompareFunc compare)
Finds (using the given compare function) and removes the node with the given value.
Definition ADTPQueue.cpp:145
DestroyFunc setDestroyValue(DestroyFunc destroyValue)
Set the Destroy Value object.
Definition ADTPQueue.cpp:139
~PQueue()
Destroy the PQueue object.
Definition ADTPQueue.cpp:86
int find(Pointer value, CompareFunc compare)
Finds the given value in the priority queue and returns its nodeId.
Definition ADTPQueue.cpp:169
Pointer getMax()
Get the max element of the queue.
Definition ADTPQueue.cpp:95
int getSize()
Get the size of the priority queue.
Definition ADTPQueue.cpp:91
void removeMax()
Remove the max of the queue.
Definition ADTPQueue.cpp:120
ADT Vector.
Definition ADTVector.hpp:58