Learn CS Visual

How Queues Work

A queue always retrieves the value that was added first — an order called FIFO, first in, first out. enqueue adds a value to the back of the line, and dequeue removes the value from the front.

After enqueueing 1, 2, and 3 in order, calling dequeue once, what value comes out?