Skip to content

Commit 99cbab9

Browse files
authored
Create priority_queue_min.cpp
1 parent 98bf74b commit 99cbab9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include<queue>
2+
#include<iostream>
3+
4+
using namespace std;
5+
6+
int main(int argc, char const *argv[])
7+
{
8+
priority_queue<int, vector<int>, greater<int>> pq;
9+
pq.push(90);
10+
pq.push(20);
11+
pq.push(40);
12+
pq.push(10);
13+
while(!pq.empty()){
14+
cout<<pq.top()<<" ";
15+
pq.pop();
16+
}
17+
return 0;
18+
}

0 commit comments

Comments
 (0)