← Quiz: STL Containers: all 9 questions
Quiz: STL Containers · Question 3 of 9
By default, priorityqueue<int gives the:
By default, priority_queue<int> gives the:
- A.Largest element first
- B.Smallest element first
- C.Oldest element first
- D.Newest element first
Answer & explanation
Correct answer: Largest element first
It's a max-heap; use greater<int> for a min-heap.
Can you get the rest right without peeking?
Take the timed Quiz: STL Containers quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →