Complete the sentence to explain the FIFO principle in queues.
Queues follow the [1] principle, meaning the first element added is the first one to be removed.Queues follow the FIFO (First In, First Out) principle, where the first element added is the first to be removed, like a line at a store.
Complete the sentence to describe a real-life example of FIFO.
A queue at a ticket counter is an example of [1] because the person who arrives first gets served first.The ticket counter queue is FIFO because the first person to arrive is the first to be served, matching the queue's behavior.
Fix the error in the explanation about queue behavior.
In a queue, elements are removed in the order they were added, following the [1] principle.
The correct principle is FIFO, meaning elements leave in the order they arrive, unlike LIFO which is used in stacks.
Fill both blanks to complete the explanation of queue operations.
In a queue, the operation to add an element is called [1], and the operation to remove the oldest element is called [2].
Adding an element to a queue is called enqueue, and removing the oldest element is called dequeue, following FIFO.
Fill all three blanks to explain why queues use FIFO.
Queues use FIFO because it ensures [1] order, prevents [2] of elements, and is useful in [3] situations like waiting lines.
FIFO ensures a fair order, prevents starvation (where some elements never get processed), and matches real-life situations like waiting lines.