Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #ifndef HEAP_H
  2. #define HEAP_H
  3. #include <vector>
  4. #include <iostream>
  5. #include <exception>
  6. using namespace std;
  7.  
  8. class Heap
  9. {
  10. private:
  11. vector<int> h;
  12. public:
  13. Heap(){}
  14. Heap(vector<int>&);
  15. ~Heap(){}
  16. void add(int);
  17. void correct(int);
  18. void pop();
  19. int top()
  20. {
  21. if(!h.empty())
  22. return h[0];
  23. throw exception();
  24. }
  25. void print();
  26. void increase(int, int);
  27. void decrement(int, int);
  28. bool empty()
  29. {return h.empty();}
  30.  
  31. };
  32.  
  33.  
  34. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement