Give asymptotic upper and lower bound for \(𝑇(𝑛)\) given below. Assume…
2019
Give asymptotic upper and lower bound for \(𝑇(𝑛)\) given below. Assume \(𝑇(𝑛)\) is constant for \(𝑛≤2\). Assume \(𝑇(𝑛)\) is constant for \(𝑛≤2\). \(T(n) = 4T( \sqrt{n} ) + \lg^2n\)
- A.
\(T(n) = \theta (\lg ( \lg ^2 n) \lg n )\) - B.
\(T(n) = \theta ( \lg ^2 n \lg n )\) - C.
\(T(n) = \theta (\lg ^2 n \lg \lg n )\) - D.
\(T(n) = \theta (\lg ( \lg n) \lg n )\)
Attempted by 116 students.
Show answer & explanation
Correct answer: C
Key idea: change variables to transform the recurrence into a standard form.
Let m = lg n and define S(m) = T(2^m) (so S(lg n) = T(n)).
Rewrite the recurrence in terms of m: since √n = 2^{m/2}, we have T(√n) = S(m/2). Also lg^2 n = m^2. Hence
S(m) = 4S(m/2) + m^2
Apply the Master theorem to S(m) = aS(m/b) + f(m) with a = 4, b = 2, f(m) = m^2. We have m^{log_b a} = m^{log_2 4} = m^2, so f(m) = Theta(m^{log_b a}).
By the Master theorem (case 2), S(m) = Theta(m^2 · lg m).
Translate back to n using m = lg n:
T(n) = S(lg n) = Theta((lg n)^2 · lg lg n).
Answer: T(n) = Theta((lg n)^2 · lg lg n).
A video solution is available for this question — log in and enroll to watch it.