We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07989b3 commit 9e12b86Copy full SHA for 9e12b86
Heap/a.out
21 KB
Heap/priorityQueue.cpp
@@ -0,0 +1,25 @@
1
+/*
2
+author:gulshan yadav
3
+email: gulshany01@gmail.com
4
+date: 19-July-2021
5
+*/
6
+#include<iostream>
7
+#include<bits/stdc++.h>
8
+using namespace std;
9
+
10
11
+int main(){
12
+ // this is max heap;
13
+ priority_queue<int> pq;
14
+ // this is min heap
15
+ priority_queue<int, vector<int> , greater<int> > p;
16
+ p.push(10);
17
+ p.push(20);
18
+ p.push(30);
19
+ cout << p.top()<<endl;
20
+ while(p.empty() == false){
21
+ cout << p.top()<<" ";
22
+ p.pop();
23
+ }
24
+ return 0;
25
+}
0 commit comments