🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Queues and Deques: all 13 questions

Quiz: Queues and Deques · Question 5 of 13

In sliding window maximum, the deque holds indexes whose values are:

In sliding window maximum, the deque holds indexes whose values are:

  1. A.increasing from front to back
  2. B.decreasing from front to back
  3. C.in random order
  4. D.all equal
Answer & explanation

Correct answer: decreasing from front to back

Smaller values behind a bigger, newer one are removed, so the front is always the maximum.

Can you get the rest right without peeking?

Take the timed Quiz: Queues and Deques quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →