Show the status of queue after the following operations:
enqueue(34)
enqueue(54)
dequeue( )
enqueue(12)
enqueue(9)
enqueue(61)
dequeue( )
Show the status of queue after the following operations:
enqueue(34)
enqueue(54)
dequeue( )
enqueue(12)
enqueue(9)
enqueue(61)
dequeue( )
Solution
✅ Correct Option: 1
A queue is FIFO (First In, First Out): elements are added at the rear and removed from the front, so dequeue always removes the oldest element.
| Operation | Queue (front to rear) |
|---|---|
| enqueue(34) | 34 |
| enqueue(54) | 34, 54 |
| dequeue( ) | 54 |
| enqueue(12) | 54, 12 |
| enqueue(9) | 54, 12, 9 |
| enqueue(61) | 54, 12, 9, 61 |
| dequeue( ) | 12, 9, 61 |
Option 3: shows 12 removed as well, which would need a third dequeue.
Options 2 and 4: 61 was enqueued and never dequeued, so it must still be in the queue.
Related questions:
2026: 29 May Shift 1
2026: 11 May Shift 2
2026: 11 May Shift 2