Computer Science EngineeringHardISRO SC (CS)
Using the Master theorem (extended form), the solution of T(n) = 27T(n/3) + n^3 is:
- A. Theta(n^3 log n)
- B. Theta(n^3)
- C. Theta(n^3 log^2 n)
- D. Theta(n^4)
Correct answer: A. Theta(n^3 log n)
k = log_3 27 = 3, so case 2 (extended): Theta(n^3 log^1 n). Here a = 27, b = 3, log_b a = 3.
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
- Using the Master theorem (extended form), the solution of T(n) = 2T(n/3) + n is:
- Consider the following C fragment. int c=0; for(int i=200;i>=1;i/=2) for(int j=0;j<i;j++) c++; What is c at the end? (integer division)
- The worst-case number of key comparisons binary search makes on a sorted array of 127 elements (counting one three-way comparison per…
- Consider the following C fragment. int c=0; for(int i=0;i<20;i++) for(int j=i+1;j<20;j++) for(int k=j+1;k<20;k++) c++; What is c at the end?
- Consider the following C fragment. int c=0; for(int i=0;i<10;i++) for(int j=i+1;j<10;j++) for(int k=j+1;k<10;k++) c++; What is c at the end?
- Consider the following C fragment. int c=0; for(int i=1;i<=30;i++) for(int j=i;j<=30;j+=i) c++; What is c at the end?