Question

In: Computer Science

Use a recursion tree to determine a good asymptotic upper bound on the recurrence ?(?) =...

Use a recursion tree to determine a good asymptotic upper bound on the recurrence ?(?) = 3?(?/3) + ?. Use the substitution method to verify your answer.

Solutions

Expert Solution

Solution:

Given,

=>T(n) = 3T(n/3) + n

Explanation:

Solving recurrence relation using recursion tree:

=>Cost at each level of tree is presented.

=>Total cost can be found by summing up the costs of all the levels of recursion tree.

Verification using substitution method:

=>T(n) = 3T(n/3) + n...(1)

=>T(n/3) = 3T*n/3^2) + n/3...(2)

From (1) and (2)

=>T(n) = 3^2T(n/3^2) + n + n

and so on.

=>T(n) = 3^kT(n/3^k) + n + n + .....k times

=>T(n) = 3^kT(n/3^k) + n*k...(3)

=>Let say T(1) = 1

=>n/3^k = 1

=>n = 3^k

Taking log both sides on base 3

=>k = log3(n)..(4)

From (3) and (4)

=>T(n) = 3^log3(n)*1 + n*log3(n)

=>T(n) = n + n*log3(n)

=>Hence T(n) = O(n*log(n))

I have explained each and every part with the help of statements as well as image attached to it.


Related Solutions

Use a recursion tree to determine a good asymptotic upper bound on the recurrence T(n) =...
Use a recursion tree to determine a good asymptotic upper bound on the recurrence T(n) = 2T(n/3) + 2n. Use the substitution method to verify your answer
Use a recursion tree to determine a good asymptotic upper bound on the following recurrences. Use...
Use a recursion tree to determine a good asymptotic upper bound on the following recurrences. Use the substitution method to verify your answer. T(n) = 3T(n/2) + n. T(n) = T(n/2) + n2.
Use a recursion tree to determine a good asymptotic upper bound on the following recurrences. Use...
Use a recursion tree to determine a good asymptotic upper bound on the following recurrences. Use the substitution method to verify your answer. T(n) = 3T(n/2) + n. T(n) = T(n/2) + n2.
Use a recursive tree method to compute a tight asymptotic upper bound for recurrence function T(n)=...
Use a recursive tree method to compute a tight asymptotic upper bound for recurrence function T(n)= 2T(n/5)+3n . then use substitution method to verify your answer.
Solve the following recurrence relations: (find an asymptotic upper bound O(?) for each one) a. T(n)...
Solve the following recurrence relations: (find an asymptotic upper bound O(?) for each one) a. T(n) = T(2n/3)+T(n/3) + n^2 b. T(n) = √nT(√n) + n c. T(n) = T(n-1)+T(n/2) + n The base case is that constant size problems can be solved in constant time (O(1)). You can use the induction, substitution or recursion tree method
Use the recursion tree method to determine the asymptoticupper bound of T(n).T(n) satisfies the recurrence T(n)=2T(n-1)+...
Use the recursion tree method to determine the asymptoticupper bound of T(n).T(n) satisfies the recurrence T(n)=2T(n-1)+ c, where c is a positive constant, andT(0)=0.
Derive a Θ-bound on the solution to the following recurrence. using iterative recursion and check your...
Derive a Θ-bound on the solution to the following recurrence. using iterative recursion and check your answer with master theorem result T(n) = T (1/3 n) + log n
Give asymptotic tight bounds for T(n) in each of the following recurrences using recursion tree. a....
Give asymptotic tight bounds for T(n) in each of the following recurrences using recursion tree. a. T(n) = 2T(n − 1) + 1 b. T(n) = t(n − 1) + n c. T(n) = 2T (n/4) + √n
Explain recurrence including the explanation of Merge-sort and recursion tree. Then provide one example of pros...
Explain recurrence including the explanation of Merge-sort and recursion tree. Then provide one example of pros and cons.
Use recursion tree to solve the recurrence: T(n) = T(n/15) + T(n/10) + 2T(n/6) + n^(1/2)
Use recursion tree to solve the recurrence: T(n) = T(n/15) + T(n/10) + 2T(n/6) + n^(1/2)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT