From 4e0843dff18d7b88c79fc4771ed7e025caab27b9 Mon Sep 17 00:00:00 2001 From: Sagun-png <67581440+Sagun-png@users.noreply.github.com> Date: Sat, 2 Oct 2021 12:15:33 +0530 Subject: [PATCH] Create Priority Queue.cpp --- CPP/Priority Queue.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 CPP/Priority Queue.cpp 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<