I hope you solve all the points with the right answers and with
Screenshot please,
Question 3: (15 Marks) a) Find the complexity of the following blocks of code or algorithm's description. [Note: your answer must show the steps that lead to your final answer] (3 marks each) 1) The algorithm solves the problem of 2) The algorithm solves the problem size n by dividing it into 16 sub- by breaking it into 8 sub-problems problems of size n/2, recursively of 1/2 the scale, recursively solving each sub-problem, and then solving each sub-maze, and then combining the solutions in O(n^) combining the solutions in linear time time 3) The algorithm solves the problem of size n by recursively solving two sub-problems of size n-1, and then combining the solutions in constant time. b) Consider the following function Progression(n), compute its complexity: (6 marks) def Progression (n) { if n == 0: return 1 else return (2 Progression (n-1) + More()) Given that the complexity of More() function is of a constant order
I hope you solve all the points with the right answers and with Screenshot please,
-
- Site Admin
- Posts: 899559
- Joined: Mon Aug 02, 2021 8:13 am