Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Your IT department produced a revolutionary new algorithm call foo and your boss wants you to give the maximum and minimum number of times each
Your IT department produced a revolutionary new algorithm call foo and your boss wants you to give the maximum and minimum number of times each line will execute as a function of n where is the number of rows in W. Some of the information is already filled in foo(W,n) Max: 1 int phiplin1n] {}; for k = 1 to n do o Max: 1,Min: 1 Max: , Min: D Max: Min: D Max: Min: D Max: Min: D Max: Min: phi [n] [n-deanMatrir(n) for i = 1 to n do for j = 1 to n do D Max: Min D Max Min: 0 D Max: .Min: 0 else D Max D Max: Min: 0 Min: 0 end if end for end for end forreturn Dn and phi D Max: Min Assume that each line executes in a certain number of cycles: Lines 3, 6, 7, 8, 9, and 10 exocute in 1 cycle each. Lines 4 and 5 execu 2 cycles esch. Line 12 executes in 2 cycles Line 13 executes in 3 cycles. All other lines are optimized sway by the compiler and take no cycles. 1. Give a formula that describes the maximum number of cycles as a function of r 2. Give a formula that describes the minimum number of cycles as a function of n
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started