1 part i fundamental problem 1 8 marks 1 page consider the algorithm m
1 Part I: Fundamental
Problem 1 (8 marks, 1 page). Consider the algorithm mystery() whose input consists
of an array A of n integers, two nonnegative integers P, u satisfying 0 ≤ P ≤u≤n-1, and
an integer k. We assume that n is a power of 2.
if P == u then
if A[P] == k then
mystery(A[o.....(n − 1)], P, u, k)
m = b(P + u-1)/2];
return mystery(A, P, m, k) + mystery(A, m+ 1, u, k);
a) [2 marks] What does mystery (A[0..(n-1)],0, n-1, k) compute (0.5 mark)?
Justify your answer (1.5 marks).
b) [1 mark] What is the algorithmic paradigm that the algorithm belongs to?
c) [2 marks] Write the recurrence relation for C(n), the number of additions
required by mystery(A, 0, n - 1, k).
d) [2 marks] Solve the above recurrence relation by the backward substitution
method to obtain an explicit formula for C(n) in n.
e) [1 mark] Write the complexity class that C(n) belongs to using the Big-O notation.
*The amount will be in form of wallet points that you can redeem to pay upto 10% of the price for any assignment. **Use of solution provided by us for unfair practice like cheating will result in action from our end which may include permanent termination of the defaulter’s account.Disclaimer:The website contains certain images which are not owned by the company/ website. Such images are used for indicative purposes only and is a third-party content. All credits go to its rightful owner including its copyright owner. It is also clarified that the use of any photograph on the website including the use of any photograph of any educational institute/ university is not intended to suggest any association, relationship, or sponsorship whatsoever between the company and the said educational institute/ university. Any such use is for representative purposes only and all intellectual property rights belong to the respective owners.