Question: Please provide as much detail as possible for each question to gain a upvote. Thanks. please give the question to someone else The objective of

Please provide as much detail as possible for each question to gain a upvote. Thanks.

please give the question to someone else

Please provide as much detail as possible for each question to gaina upvote. Thanks. please give the question to someone else The objective

of this assignment is to analyze a simple matrix transposition algorithm. Below

The objective of this assignment is to analyze a simple matrix transposition algorithm. Below is its pseudocode of the simplified Transposition algorithm of an nxn matrix A. Transpose (A) 1 for i = 1 to n-1 2 for j = i+1 to n 3 exchange A[i,j] with A[j,i] Running Time of Transpose (90 points) a. (2 points) What is the input size? b. (40 points) Count precisely the total number of comparisons C(n) performed by the for loops in Lines 1 and 2. Express C(n) as a function of n. (Use the same steps we used in the previous lectures and homework assignments to analyze nested for loops. Use a table like in Homework 1. Be as precise as Student 3 (See Appendix) C. (2 points) What is the asymptotic bound for C(n)? d. (40 points) Count precisely the total number of exchanges E(n) performed by Line 3. Express E(n) as a function of n. (Use the same steps we used in the previous lectures and homework assignments to analyze nested for loops. Use a table like in Homework 1. Be as precise as Student 3 (See Appendix) e. (2 points) What is the asymptotic bound for E(n)? f. (4 points) Which function (C(n)? or E(n)) yield the right asymptotic growth? Which one (C(n)? or E(n)) is more convenient to derive the asymptotic growth of the running time of the Transpose algorithm? for j INSERTION-SORT (A) 1 = 2 to A.length n comparisons 2 key A[j] 3 // Insert A[j] into the sorted sequence A[1.. j - 1]. 4 i = j - 1 5 while i > 0 and A[i] > key 2.j - I comparisons (t; = j all the time) 6 A[i + 1] = A[i] 7 i =i-1 T(n)=n+ 1 8 A[i + 1] = key = 11 23-1=n+2, 1= nin+1) = n+20 - 1)-(n-1) = n(n+1)-1= 2(n) 2 12

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Chemical Engineering Questions!