Computer Science EngineeringVery hard
The recurrence T(n) = 4T(n/2) + n^2 has solution
- A. Theta(n^2)
- B. Theta(n^2 log n)
- C. Theta(n^3)
- D. Theta(n log n)
Correct answer: B. Theta(n^2 log n)
Here n^(log2 4) = n^2 matches f(n), so case 2 of the master theorem gives n^2 log n.
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 time complexity of topological sorting of a DAG with V vertices and E edges using DFS is
- Which of the following standard sorting algorithms is stable?
- In a max-heap, the largest element is always located at
- A simple undirected graph has 10 vertices and exactly 3 connected components. What is the maximum possible number of edges?
- How many distinct spanning trees does the complete graph K4 have?
- The best-case running time of insertion sort (already sorted input) is