| 123456789101112131415161718192021222324 |
- //testing priority queue
- #include <cstdio>
- #include <iostream>
- #include <string>
- #include <fstream>
- #include <sstream>
- #include "priorityqueue.h"
- int main(){
- class PriorityQueue h;
- h.initiateHeap(20);
- h.insert(3);
- h.insert(2);
- h.insert(15);
- h.insert(5);
- //h.removeKey(2);
- h.insert(4);
- h.insert(45);
- //h.removeKey(15);
- h.removeMax();
- //h.decreaseKey(2, 1);
- h.printArray();
- return 0;
- }
|