Multiple choice

When linear queue of size MAXQUEUE were implemented in C, underflow occurs at

  1. Front = 0

  2. Rear = -1

  3. Rear = Front

  4. Rear - Front + 1 = 0

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In a linear queue implemented with an array, the condition Rear - Front + 1 = 0 (or simply Rear < Front) indicates that the queue is empty, meaning an underflow occurs if a dequeue operation is attempted.