testCode.cxx 413 B

123456789101112131415161718192021222324
  1. //testing priority queue
  2. #include <cstdio>
  3. #include <iostream>
  4. #include <string>
  5. #include <fstream>
  6. #include <sstream>
  7. #include "priorityqueue.h"
  8. int main(){
  9. class PriorityQueue h;
  10. h.initiateHeap(20);
  11. h.insert(3);
  12. h.insert(2);
  13. h.insert(15);
  14. h.insert(5);
  15. //h.removeKey(2);
  16. h.insert(4);
  17. h.insert(45);
  18. //h.removeKey(15);
  19. h.removeMax();
  20. //h.decreaseKey(2, 1);
  21. h.printArray();
  22. return 0;
  23. }