Question:medium

To perform enqueue and dequeue efficiently on a queue, which of the following operations are required?
A) isEmpty
B) peek
C) isFull
D) update

Show Hint

For queues: Enqueue requires \texttt{isFull} check, Dequeue requires \texttt{isEmpty} check, and Peek helps to view the next element.
Updated On: Feb 15, 2026
  • (A), (B) and (D) only
  • (A), (B) and (C) only
  • (B), (C) and (D) only
  • (A), (C) and (D) only
Show Solution

The Correct Option is B

Solution and Explanation

Phase 1: Comprehending Queue Operations.
- isEmpty: Verifies if the queue is empty prior to dequeueing.
- peek: Retrieves the front element without removal, enhancing efficiency.
- isFull: Checks queue capacity before enqueueing, crucial for circular implementations.
- update: This is not a typical queue operation.
Phase 2: Discarding Incorrect Options.
Given that isEmpty, peek, and isFull are necessary, the correct selection comprises (A), (B), and (C).
Concluding Response: \[\boxed{\text{(A), (B) and (C) exclusively}}\]
Was this answer helpful?
0


Questions Asked in CUET (UG) exam