Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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
You can’t perform that action at this time.