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.

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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.

Post 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 24 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 24 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply