Skip to main contentSkip to solution

A normal linear queue if implemented using an array / list of size MAX_SIZE, gets full when:

Solution

✅ Correct Option: 1

In a linear queue, elements are added at REAR and removed from FRONT. Indices run from 0 to MAXSIZE - 1, and REAR moves forward with each insertion and never wraps around. Once REAR = MAXSIZE - 1, there is no index left to insert into, so the queue is full. This holds even if some elements were dequeued, because the freed slots at the front are not reused.


Option 2: FRONT = REAR + 1 is the kind of condition used for a circular queue (or for an empty queue in some linear implementations), not for a full linear queue.

Option 3: FRONT = REAR means the queue has only one element (or is empty, depending on the convention), not that it is full.

Option 4: FRONT = MAXSIZE - 1 only shows that FRONT has reached the last index, which says nothing about whether REAR can still move forward.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question