UGC NET Paper 2 (Computer Science)Hard
The recurrence T(n) = 3T(n/3) + n/2 has the solution:
- A. Theta(n log n)
- B. Theta(n)
- C. Theta(n^2)
- D. Theta(n log log n)
Correct answer: A. Theta(n log n)
Here n^(log_3 3) = n equals f(n) = n/2 up to a constant, so the master theorem's case 2 applies, giving an extra log factor.
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
- In quicksort, if the recursive call is always made on the smaller of the two partitions first, the worst-case auxiliary stack depth is:
- Which of the following NP-complete problems is only weakly NP-complete, i.e. solvable in pseudo-polynomial time?
- The maximum possible height of a red-black tree with n internal nodes is:
- In a B-tree with minimum degree t (t >= 2), every node other than the root must contain at least:
- The amortized time complexity of an operation (search, insert or delete) on a splay tree with n nodes is:
- The minimum number of states in a DFA over {0, 1} accepting exactly the strings that end with 00 is: