Skip to content

Instantly share code, notes, and snippets.

@shameemreza
Created June 5, 2018 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shameemreza/06d7c75a0dfd787415efee1df5c5cc15 to your computer and use it in GitHub Desktop.
Save shameemreza/06d7c75a0dfd787415efee1df5c5cc15 to your computer and use it in GitHub Desktop.
#include<priority-queue>
using namespace std;
priority-queue<int> PQ; //decalre a max heap
PQ.push(4); //insert
PQ.top(); //maximum element
PQ.pop(); //pop max
PQ.size(); //returns size of heap
PQ.empty(); //returns 1 if heap is empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment