Question PRG-CPP-0016
HardWhat is the output of this program?
#include <iostream>
#include <queue>
using namespace std;
int main() {
priority_queue<int> pq;
for (int x : {1, 3, 2}) pq.push(x);
while (!pq.empty()) { cout << pq.top() << " "; pq.pop(); }
return 0;
}
- A.
1 3 2
- B.
1 2 3
- C.
Sign up free to see the answer and a step-by-step explanation.