diff --git a/CPP/Priority Queue.cpp b/CPP/Priority Queue.cpp new file mode 100644 index 000000000..0883647d7 --- /dev/null +++ b/CPP/Priority Queue.cpp @@ -0,0 +1,39 @@ +#include +#include +#include +using namespace std; + +int main() +{ + { + priority_queue q; + for(int elm: {1,8,5,6,3,4}) + q.push(elm); + while(!q.empty()){ + cout<, greater> q2; + for(int elm: {1,8,5,6,3,4}) + q2.push(elm); + while(!q2.empty()){ + cout<, decltype(cmp)> q3(cmp); + for(int elm: {1,8,5,6,3,4}) + q3.push(elm); + while(!q3.empty()){ + cout<