Question: Question 5 (a) Show how to use the Master Theorem to solve recurrence relations. [4 marks] ------------------------------------------------------------------------------------------------------ Question 5 (b) Use the Master Theorem to
Question 5
(a) Show how to use the Master Theorem to solve recurrence relations. [4 marks]
------------------------------------------------------------------------------------------------------
Question 5 (b) Use the Master Theorem to solve the following recurrence relation:
T(n) = 8T(n/2) + n2 [4 marks]
-------------------------------------------------------------------------------------------------------
(c) Use dynamic programming to solve the following knapsack problem:-
Weights and values of the items are given in the following pairs:
(5 kg, 20), (2 kg, 12), (4 kg, 14), (3 kg, 11), (1 kg, 8), where the knapsack capacity is 7 kg.
[7 marks]
----------------------------------------------------------------------------------------------------------
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
