Question: # You may assume n is an integer >= 0 def f(n): while n > 0: for i in range(n): print(i) n = n -

 # You may assume n is an integer >= 0 deff(n): while n > 0: for i in range(n): print(i) n =n - 1 O(1) Ollog n) O(n) O(n log n) Q(n^2) O(n^3)

# You may assume n is an integer >= 0 def f(n): while n > 0: for i in range(n): print(i) n = n - 1 O(1) Ollog n) O(n) O(n log n) Q(n^2) O(n^3) 0(2^n) # You may assume n is an integer >= 0 def f(n): if n > 100: return 0 else: return f(n+1) O(1) Odlog n) O(n) On log n) O(n^2) O O(n^3) O O(2^n) # you may assume s is a string containing n characters def f(s): x = len(s) y = s while x > 0: S = y while len(s) > 0: S = s[:len(s)//2] x = x - 1 O(1) Ollog n) Q(n) O(n log n) O(n^2) O(n^3) O(2^n)

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!