Question: def q1cd(n): result = 1 i = 1 while i < n: result = result + (2 * i) i = i + 1 for

def q1cd(n):

result = 1

i = 1

while i < n:

result = result + (2 * i)

i = i + 1

for num in range(n):

result = result + (num - 10)

return result

c. If function q1cd(10000) requires 2 seconds to execute, approximately how long will q1cd(20000) take? d. Give a tight Big-O running time bound for q1cd. I.e. q1cd(n) = O(?)

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!