GATE Computer ScienceModerateGATE CS (PYQ pattern)
Which is the tight solution of T(n) = 3T(n/4) + n^(log₄3)·log₂ n?
- A. Θ(n^(log₄3)·log² n)
- B. Θ(n^(log₄3)·log n)
- C. Θ(n log n)
- D. Θ(n^(log₄3))
Correct answer: A. Θ(n^(log₄3)·log² n)
Here f(n) = n^(log_b a)·log n, the extended case 2 of the master theorem with k = 1, so T(n) = Θ(n^(log₄3)·log^(k+1) n) = Θ(n^(log₄3) log² n). Every one of the log₄ n levels costs about n^(log₄3)·(log n − 2i), which sums to a log² factor.
More Algorithms questions
- Solve T(n) = 2T(√n) + log₂ n for large n. Which is the tight bound?
- Let T(n) = T(n − ⌊√n⌋) + 1 for n > 1 and T(1) = 0. Which is the tight bound?
- Let T(n) = T(n/2) + n(2 − cos n) (n in radians) with T(1) = 1. Which statement about T(n) is correct?
- How many times does x++ execute? for (i = 1; i <= 64; i = 2) for (j = 1; j <= i; j++) for (k = j; k <= i; k = 2) x++;
- How many times does x++ execute? for (i = 1; i <= 200; i++) { j = 1; while (j <= i) { x++; j = 3; } }
- How many balanced parenthesis strings with 6 pairs have nesting depth at most 2?