Question: 1 5 ) Select from multiple dropdowns. Examine the following pseudocode. Each line is numbered ( leftmost number ) . The objective of this exercise

15) Select from multiple dropdowns.
Examine the following pseudocode. Each line is numbered (leftmost number).
The objective of this exercise is to determine the time complexity of this algorithm that takes as input an n x n matrix M and computes its transpose. We assume that the first line starts at i=1 and the first column starts at j =1.
Line # 2 performs [ Select ]["n+1", "None of these answers", "n+2","n","n-1"] comparisons and [ Select ]["n","n+2","n-1","n+1", "None of these answers"] additions during the full execution of this algorithm. Let us call tk the number of times the statement "buffer = M[j][i]" is executed when i=k. t1 is equal to [ Select ]["None of these answers", "n-j","n+1","n-1","n"]. t2 is equal to [ Select ]["n-1", "None of these answers", "n","n+1","n-j+1"]. t3 is equal to [ Select ]["n-3","n-j+3","n-1","n-2", "None of these answers"]. tn-1 is equal to [ Select ]["None of these answers", "2","n-j+n-1","3","1"]. tn is equal to [ Select ]["1","0","2","n-n+2", "None of these

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 Databases Questions!