Recall & Review
beginner
What is a Queue in data structures?
A Queue is a collection where elements are added at one end (rear) and removed from the other end (front), following the First In First Out (FIFO) principle.
Click to reveal answer
beginner
Explain the FIFO principle in simple terms.
FIFO means First In First Out. The first element added to the queue will be the first one to be removed, like people standing in a line waiting their turn.
Click to reveal answer
beginner
What are the two main operations of a queue?
The two main operations are Enqueue (adding an element at the rear) and Dequeue (removing an element from the front).
Click to reveal answer
beginner
In a queue, if elements are added in order: 5, 10, 15, what will be the order of removal?
The elements will be removed in the same order they were added: 5, then 10, then 15.
Click to reveal answer
beginner
Why is a queue useful in real life? Give one example.
Queues help manage tasks in order. For example, a printer queue prints documents in the order they were sent, so no document is skipped or printed out of turn.
Click to reveal answer
What does FIFO stand for in the context of a queue?
✗ Incorrect
FIFO means the first element added is the first one removed, like a queue line.
Which operation adds an element to the queue?
✗ Incorrect
Enqueue adds an element at the rear of the queue.
Where are elements removed from in a queue?
✗ Incorrect
Elements are removed from the front of the queue.
If a queue has elements 1, 2, 3 in order, which element will be removed first?
✗ Incorrect
The first element added (1) is removed first following FIFO.
Which real-life example best represents a queue?
✗ Incorrect
People waiting in line follow FIFO, just like a queue.
Describe how a queue works and explain the FIFO principle with a simple example.
Think about a line of people waiting for service.
You got /5 concepts.
List and explain the main operations of a queue and how they maintain the FIFO order.
Focus on where elements enter and leave the queue.
You got /4 concepts.
