Multiple choice

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

  1. Front = MAXQUEUE

  2. Rear = MAXQUEUE -1

  3. Rear = Front

  4. Rear - Front + 1 = 0

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

In a linear queue implemented with an array of size MAXQUEUE, the rear pointer increments with each insertion. Overflow occurs when the rear pointer reaches the last index, which is MAXQUEUE - 1.