The processing time of an algorithm is described by the following recurrence equ
ID: 3853847 • Letter: T
Question
The processing time of an algorithm is described by the following recurrence equation (c is a positive constant): T(n) = 3T(n/3) + 2cn; T(1) = 0 What is the running time complexity of this algorithm?
Justify using the Master Theorem:
Let a >= 1, b > 1, d >= 0, and T(N) be a monotonically increasing function of the form: T(N) = aT(N/b) + O(N^d);
a is the number of subproblems, N/b is the size of each subproblem, N^d is the “work done” to prepare the subproblems and assemble/combine the subresults
T(N) is O(N^d); if a < b^d
T(N) is O(N^d logN); if a = b^d
T(N) is O(N logb a); if a > b^d
Explanation / Answer
the time com[plexity is O(n logn) by applying Masters theorem Case2
given eqn T(n)=3T(n/3)+2Cn with T(n)=aT(n/b)+f(n)
1. If f(n) = (nc) where c < Logba then T(n) = (nLogba)
2. If f(n) = (nc) where c = Logba then T(n) = (ncLog n)
3.If f(n) = (nc) where c > Logba then T(n) = (f(n))
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.