Page 1 of 1

1. Let the contents of a queue Q[] be 25, 32, 48, 55, 77 with 25 at the rear end and 77 at front. Let Q.enqueue() and Q.

Posted: Wed Mar 30, 2022 9:26 am
by answerhappygod
1 Let The Contents Of A Queue Q Be 25 32 48 55 77 With 25 At The Rear End And 77 At Front Let Q Enqueue And Q 1
1 Let The Contents Of A Queue Q Be 25 32 48 55 77 With 25 At The Rear End And 77 At Front Let Q Enqueue And Q 1 (371.17 KiB) Viewed 25 times
1 Let The Contents Of A Queue Q Be 25 32 48 55 77 With 25 At The Rear End And 77 At Front Let Q Enqueue And Q 2
1 Let The Contents Of A Queue Q Be 25 32 48 55 77 With 25 At The Rear End And 77 At Front Let Q Enqueue And Q 2 (325.12 KiB) Viewed 25 times
please answer both the questions
very urgent
1. Let the contents of a queue Q[] be 25, 32, 48, 55, 77 with 25 at the rear end and 77 at front. Let Q.enqueue() and Q.dequeue() be the standard enqueue and dequeue func- tions respectively. Consider the following pseudocode. Assuming the array Q to be sufficiently large (queue never becomes full), describe the queue (contents) by the end of the following sequence of operations. temp < Q.dequeue() + Q.dequcuc() temp + temp/11 Q.enqucuc(temp) Q.enqueue(Q.dequeue)
5. Consider the following Algorithm Task(A,n). Assume array A[O...n - 1) contains n distinct positive values. Identify the best case and worst-case performance scenarios, estimate the number of primitive operations in both cases, and hence express the corre- sponding running times (both best and worst) of the algorithm using big-O notation. 1 function TASK(A,n) for j < 1 to n-1 do k Aj id j-1 while i > 0 and A > k do print Ai 1 end while j{ j +1 end for funeftan