Skip to main contentSkip to solution

Sequence the complete process of enqueue operation in a queue:

(A) Add the element to the rear of the queue.

(B) Check if the queue is full.

(C) Increment the rear pointer.

(D) Return success message.

Solution

✅ Correct Option: 3

Check if the queue is full (B)

Add the element to the rear of the queue (A)

Increment the rear pointer (C)

Return success message (D)

The full check must come first, because adding to a full queue causes overflow. The success message comes last, after the insertion is complete.


Options 1 and 2: they add the element before checking whether the queue is full, which risks overflow.

Option 4: it increments the rear pointer before checking for space, and returns success before the element is added.

Keyboard Shortcuts

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