Question

A queue initially empty undergoes the following sequence of operations: 1.  enqueue(10) 2.  enqueue(20) 3.  dequeue() 4.  enqueue(30) 5.  dequeue() 6.  enqueue(40) What is the final state of the queue (elements from front to rear)?

A [10, 20, 30, 40]
B [30, 40]
C [40]
D [10, 40]
E [20, 30, 40]
Practice Next

Hey! Ask a query