Jonathan S.

asked • 03/23/21

Calculate the worst-case running time of the algorithm using Big-Oh notation. Indicate how you arrived at the answer. Then give the name of the Big-Oh complexity.

Pestiferous(n)

r=0

for i = 1 to n do

for i = 1 to i do

for k = j to i + j do

for l = 1 to i + j - k do

r = r + 1

return(r)


Tobias K.

Please add brackets to clarify how the for loops are nested.
Report

03/23/21

Jonathan S.

I hope the update suffices?
Report

03/23/21

1 Expert Answer

By:

Justin K. answered • 03/29/21

Tutor
5 (29)

Experienced Software Engineer Excited to Teach Math/Programming

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.