Queue · Class 12 · CBSE · Science Computer Science

A queue currently contains [12, 18, 25], where 12 is at the front. After one dequeue, one enqueue of 31, and one more dequeue, which list represents…

Practice question from Queue (Class 12 · CBSE · Science Computer Science), with the correct answer and a step-by-step solution.

easy · MCQ · Q-AF4DF7

A queue currently contains [12, 18, 25], where 12 is at the front. After one dequeue, one enqueue of 31, and one more dequeue, which list represents the queue from front to rear?

  1. A.[12, 18, 25, 31]
  2. B.[18, 25, 31]
  3. C.[25, 31]Correct answer
  4. D.[31, 25]

Solution

The first dequeue removes 12, and the enqueue adds 31 at the rear. The second dequeue removes 18, leaving [25, 31].

More from Queue

All of Queue

Practise more Computer Science

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed