Computer Science EngineeringHardISRO SC (CS)
Using the Master theorem (extended form), the solution of T(n) = 4T(n/2) + n log^2 n is:
- A. Theta(n)
- B. Theta(n log n)
- C. Theta(n log^2 n)
- D. Theta(n^2)
Correct answer: D. Theta(n^2)
f(n) = n^1 log^2 n is polynomially smaller than n^(log_2 4) = n^2, so case 1 gives Theta(n^2). Here a = 4, b = 2, log_b a = 2.
Practise more Algorithms, Data Structures & Programming (ISRO CS) questionsAlgorithms, Data Structures & Programming (ISRO CS): notes and key points
More Algorithms, Data Structures & Programming (ISRO CS) questions
- The keys [40, 18, 25, 51, 17, 19] are inserted in this order into an initially empty AVL tree. The height of the final tree, counted in…
- 0/1 knapsack: item weights [4, 3, 3, 8, 7], values [18, 11, 18, 8, 4], capacity 15. The maximum total value is:
- The number of distinct spanning trees of the complete bipartite graph K2,4 is:
- The number of distinct permutations of 1..6 that can be produced as output by pushing 1,2,...,6 in order onto a stack and popping at any…
- The number of distinct combinations (order ignored) of coins from [2, 5, 3, 6] (unlimited supply of each) that sum to 10 is:
- The minimum number of coins needed to make 6 from denominations [1, 3, 4] (unlimited supply) is: