Recall & Review
beginner
What is a queue in data structures?
A queue is a collection where elements are added at the back (rear) and removed from the front, following the First-In-First-Out (FIFO) principle.
Click to reveal answer
beginner
What does 'enqueue' operation do in a queue implemented using an array?
Enqueue adds an element to the rear (end) of the queue if there is space available in the array.
Click to reveal answer
beginner
What does 'dequeue' operation do in a queue implemented using an array?
Dequeue removes the element from the front of the queue and shifts the remaining elements forward to maintain order.
Click to reveal answer
intermediate
Why do we need to shift elements after dequeue in a simple array queue?
Because the front moves forward, to keep the queue elements contiguous at the start of the array, we shift all elements left by one position after dequeue.
Click to reveal answer
intermediate
What is a limitation of a simple queue implemented using an array without circular logic?
The queue can become full even if there is space at the start of the array because the rear only moves forward and does not wrap around, leading to inefficient space use.
Click to reveal answer
In a queue implemented using an array, where is the new element added?
✗ Incorrect
New elements are always added at the rear (end) of the queue.
What happens to the elements after a dequeue operation in a simple array queue?
✗ Incorrect
After dequeue, elements are shifted left to fill the empty front position.
What does FIFO stand for in the context of queues?
✗ Incorrect
FIFO means the first element added is the first one to be removed.
What is a common problem with a simple array queue when many dequeue operations happen?
✗ Incorrect
Because the rear only moves forward, the array can appear full even if front positions are empty.
Which operation removes an element from the queue?
✗ Incorrect
Dequeue removes the front element from the queue.
Explain how enqueue and dequeue operations work in a queue implemented using an array.
Think about where elements enter and leave the queue and what happens inside the array.
You got /4 concepts.
Describe the main limitation of a simple array-based queue and why it happens.
Consider what happens when many elements are dequeued but the array still looks full.
You got /4 concepts.
