GATE Computer ScienceHardGATE CS (PYQ pattern)
The solution of T(n) = 4T(n/2) + n² log n is:
- A. Θ(n² log² n)
- B. Θ(n² log n)
- C. Θ(n³)
- D. Θ(n² log³ n)
Correct answer: A. Θ(n² log² n)
Here n^(log₂4) = n² and f(n) = n² log n, which matches the extended case f = Θ(n^(log_b a) · log^k n) with k = 1 ≥ 0. The solution is Θ(n² log^(k+1) n) = Θ(n² log² n), a case the basic master theorem does not cover.
More Algorithms questions
- Matrices A1 to A6 have dimensions 5×40, 40×10, 10×30, 30×8, 8×25 and 25×6. The minimum number of scalar multiplications needed to compute…
- A text uses 8 symbols with frequencies 5, 9, 12, 13, 16, 45, 3 and 7. If a Huffman code is built, the total number of bits needed for the…
- A 0/1 knapsack has capacity 50 and items given as (value, weight): (60, 10), (100, 20), (120, 30), (75, 25). The maximum total value is:
- Which of the following statements are correct? (I) 2-SAT can be solved in polynomial time. (II) Subset-sum has a pseudo-polynomial…
- An AVL tree is a binary search tree in which the heights of the two subtrees of every node differ by at most 1. Taking the height of a…
- A B-tree has minimum degree t = 3 (every node other than the root holds between t − 1 and 2t − 1 keys; the root holds at least 1 key) and…