Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef HEAP_H
- #define HEAP_H
- #include <vector>
- #include <iostream>
- #include <exception>
- using namespace std;
- class Heap
- {
- private:
- vector<int> h;
- public:
- Heap(){}
- Heap(vector<int>&);
- ~Heap(){}
- void add(int);
- void correct(int);
- void pop();
- int top()
- {
- if(!h.empty())
- return h[0];
- throw exception();
- }
- void print();
- void increase(int, int);
- void decrement(int, int);
- bool empty()
- {return h.empty();}
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement