In a queue, which operation is performed in constant time?

Practice Questions

1 question
Q1
In a queue, which operation is performed in constant time?
  1. Enqueue
  2. Dequeue
  3. Peek
  4. All of the above

Questions & Step-by-step Solutions

1 item
Q
Q: In a queue, which operation is performed in constant time?
Solution: All operations (enqueue, dequeue, and peek) can be performed in constant time O(1) in a properly implemented queue.
Steps: 5

Related Questions

Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely