Question:

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: Sep 18, 2025
  • (A), (B) and (D) only
  • (A), (B) and (C) only
  • (B), (C) and (D) only
  • (A), (C) and (D) only
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

Step 1: Understanding queue operations.
- isEmpty: Needed to check if the queue is empty before performing dequeue.
- peek: Allows viewing the front element without removing it. Useful for efficiency.
- isFull: Required to check if the queue is full before performing enqueue (important in circular queues).
- update: Not a standard queue operation.
Step 2: Eliminate wrong choices.
Since isEmpty, peek, and isFull are required, correct set is (A), (B), (C).
Final Answer: \[ \boxed{\text{(A), (B) and (C) only}} \]
Was this answer helpful?
0
0

Questions Asked in CUET exam

View More Questions