🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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:

  1. A.Largest element first
  2. B.Smallest element first
  3. C.Oldest element first
  4. 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 →