Computer Science and Engineering Queues Question #5758
Single Choice Easy

QWhat is the time complexity of the enqueue and dequeue operations on a queue implemented using an array?

ID: #5758 Queues 198 views
Question Info
#5758Q ID
EasyDifficulty
QueuesTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A O(1)
  • B O(log n)
  • C O(n)
  • D O(n log n)
Correct Answer

Explanation

Answer: a) O(1)

Explanation: The enqueue and dequeue operations on a queue implemented using an array have a time complexity of O(1), since they simply involve adding or removing an element from the beginning or end of the array.

Share This Question

Challenge a friend or share with your study group.