Sail E0 Webinar
Question
Consider the following operation along with Enqueue and Dequeue operations on queues, where k is a global parameter.
MultiDequeue(Q){ 
         m = k          while (Q is not empty) and (m > 0) {                       Dequeue(Q)                       m = m “ 1           } }What is the worst case time complexity of a sequence of n queue operations on an initially empty queue?
Options:
A .  ÃŽËœ(n)
B .  ÃŽËœ(n + k)
C .  ÃŽËœ(nk)
D .  ÃŽËœ(n2)
Answer: Option A


-NA-



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

More Questions on This Topic :


Latest Videos

Latest Test Papers