| 1234567891011121314151617181920212223 |
- //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.printArray();
- return 0;
- }
|