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
Get step-by-step solutions from verified subject matter experts
