GATE CS 2016 · Set-1 · Asymptotic Analysis & Recurrences

MCQ · 1 mark · Problem PROG-DIVC-0184

A queue is implemented using an array such that ENQUEUE and DEQUEUE operations are performed efficiently. Which one of the following statements is CORRECT (n refers to the number of items in the queue)?
  1. A
    Both operations can be performed in O(1) time
  2. B
    At most one operation can be performed in O(1) time but the worst case time for the other operation will be \(\Omega\)(n)
  3. C
    The worst case time complexity for both operations will be \(\Omega\)(n)
  4. D
    Worst case time complexity for both operations will be \(\Omega\)(logn)

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solutionOfficial GATE Answer Key: Option A.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/39667/gate2016-1-10

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com