
/* -----------------------------------------------------------
   C++ Priority Queue Methods

   Methods	Description
   push()	inserts the element into the priority queue
   pop()	removes the element with the highest priority
   top()	returns the element with the highest priority
   size()	returns the number of elements
   empty()	returns true if the priority_queue is empty
   ----------------------------------------------------------- */

#include<iostream>
#include <queue>
using namespace std;

int main() 
{

  // create a queue of int
  priority_queue<int> numbers;

  // add items to priority_queue
  numbers.push(1);
  numbers.push(20);
  numbers.push(7);
  numbers.push(6);
  numbers.push(15);

  cout << "Priority Queue: ";

  // Remove elements in priority queue (always in descending order !)
  while(!numbers.empty()) 
  {
     cout << numbers.top() << ", ";   
     numbers.pop();
  }

  cout << endl;

  return 0;
}
