Question 1: Give the worst-case time complexity of the functions below (Big O). Please give a brief justification for yo
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Question 1: Give the worst-case time complexity of the functions below (Big O). Please give a brief justification for yo
Question 1: Give the worst-case time complexity of the functions below (Big O). Please give a brief justification for your answer ) a) def add(b): sum = 0 for p in b: sum+=p print("sum:", sum) add([i for i in range(100)]) b) def fun(number): if number <=1: return number return (fun(number - 1) + fun(number - 2)) for i in range (1, 10): print (fun(i))
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!