Consider the following operation along with Enqueue and Dequeue - ProProfs Discuss
Advertisement

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?

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 &gt; 0) {           Dequeue(Q)           m = m &ndash; 1     }}What is the worst case time complexity of a sequence of n queue operations on an initially empty queue?<br/>

Change Image    Delete

Asked by Piyushag, Last updated: Nov 09, 2024

+ Answer
Request
Question menu
Vote up Vote down

1 Answer

piyushag1

piyushag

piyushag1
Piyushag

Answered Sep 24, 2018

Θ(n)
upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

Email Sent
We have sent an email to your address "" with instructions to reset your password.