Consider the following recursive algorithm.
Algorithm Mystery(n)
if n=1 then
Execute Task A; // Requires Θ(1) operations
else
Mystery(n/3);
Mystery(n/3);
Mystery(n/3);
Execute Task B; //Requires 2n operations
end if
Let C(n) be the complexity of Mystery(n). Use the method of
backward substitution
to determine C(n) in three steps.
a) Write the recurrence relation for C(n) including the initial
condition.
b) Write at least two substitution steps for C(n) and identify the pattern.
c) Determine the complexity class of the algorithm in terms of Θ(·).
Hand written working out helps me plenty if possible but all good if not !
Please give thumbs up if you like it
Get Answers For Free
Most questions answered within 1 hours.