Tag: time complexity of queue

Questions Related to time complexity of queue

If queue is implemented using arrays, what would be the worst run time complexity of queue and dequeue operations?

  1. $O(n), O(1)$

  2. $O(1), O(1)$

  3. $O(1), O(n)$

  4. $O(n), \theta(1)$


Correct Option: B