UGC NET Paper 2 (Computer Science)Very hard
Solve the recurrence relation given by T(n) = 2T(n/2) + n log n, assuming n is a power of 2, for its asymptotic (Theta) bound.
- A. Theta(n log n)
- B. Theta(n log^2 n)
- C. Theta(n^2)
- D. Theta(n log log n)
Correct answer: B. Theta(n log^2 n)
n^(log2 2) = n matches f(n) up to the extra log factor, so the extended master theorem (case 2 with k=1) gives Theta(n log^2 n), one power of log higher than the n/log n variant.
Practise more UGC NET Computer Science and Applications questionsUGC NET Computer Science and Applications: notes and key points
More UGC NET Computer Science and Applications questions
- The recurrence T(n) = 2T(n/2) + n/log n has the solution:
- For T(n) = T(n/2) + T(n/4) + n, the asymptotic solution is:
- The number of structurally distinct binary trees with 5 nodes is:
- The information-theoretic lower bound on the number of comparisons needed to sort 5 distinct elements is:
- Consider. I. Kruskal's algorithm runs in O(E log E) with sorting. II. Prim's algorithm with a binary heap runs in O(E log V). III…
- Matrices A (10x20), B (20x30), C (30x40) are to be multiplied. The minimum number of scalar multiplications is: