Mega Code Archive
Using a different comparison function
#include
#include
#include
using namespace std;
int main()
{
priority_queue, greater > q;
q.push(1);
q.push(3);
q.push(4);
while(!q.empty()) {
cout << "Popping ";
cout << q.top() << endl;
q.pop();
}
return 0;
}