Recall & Review
beginner
What is a queue in computing?
A queue is a way to organize items where the first item added is the first one to be removed. This is called first-in, first-out (FIFO). Imagine a line at a store checkout where the first person to get in line is the first to be served.
Click to reveal answer
beginner
Explain the term FIFO in simple words.
FIFO means First-In, First-Out. It means the first thing that goes in is the first thing that comes out, like a queue of people waiting for a bus.
Click to reveal answer
beginner
What are the two main operations of a queue?
The two main operations are:<br>1. Enqueue: Adding an item to the back of the queue.<br>2. Dequeue: Removing the item from the front of the queue.
Click to reveal answer
intermediate
Why is a queue different from a stack?
A queue removes items in the order they were added (FIFO), like a line of people. A stack removes the last item added first (LIFO), like a stack of plates where you take the top plate first.
Click to reveal answer
beginner
Give a real-life example of a queue.
A real-life example is waiting in line at a coffee shop. The first person to get in line is the first to get served, and new people join at the end of the line.
Click to reveal answer
What does FIFO stand for in queues?
✗ Incorrect
FIFO means the first item added is the first item removed, like a queue of people.
Which operation adds an item to the back of a queue?
✗ Incorrect
Enqueue means adding an item to the back of the queue.
In a queue, which item is removed first?
✗ Incorrect
Queues follow FIFO, so the first item added is removed first.
Which data structure removes the last item added first?
✗ Incorrect
A stack uses LIFO (Last-In, First-Out), removing the last item added first.
What real-life situation is like a queue?
✗ Incorrect
A line at a ticket counter is a queue where the first person in line is served first.
Describe how a queue works using a real-life example.
Think about how people wait in line for something.
You got /4 concepts.
Explain the difference between a queue and a stack.
Compare a line of people to a stack of plates.
You got /3 concepts.