Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Neo4j Data Modeling

Authors: Steve Hoberman ,David Fauth

1st Edition

1634621913, 978-1634621915

More Books

Students also viewed these Databases questions

Question

What are the objectives of Human resource planning ?

Answered: 1 week ago

Question

Explain the process of Human Resource Planning.

Answered: 1 week ago

Question

D How will your group react to this revelation?

Answered: 1 week ago