Computer Science EngineeringHardISRO SC (CS)
Using the Master theorem (extended form), the solution of T(n) = 2T(n/4) + n is:
- A. Theta(n)
- B. Theta(n log n)
- C. Theta(n log^2 n)
- D. Theta(n^(log_4 2))
Correct answer: A. Theta(n)
f(n) = n^1 dominates n^0.5 and the regularity condition holds, so T(n) = Theta(f(n)) = Theta(n). Here a = 2, b = 4, log_b a = 0.5.
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 [10, 14, 40, 49, 41, 19, 38] are inserted in this order into an initially empty AVL tree. Its preorder traversal is:
- A connected simple undirected graph has 8 vertices and 12 edges. The minimum number of edges that must be removed to obtain a spanning…
- A connected simple undirected graph has 10 vertices and 17 edges. The minimum number of edges that must be removed to obtain a spanning…
- The worst-case number of key comparisons binary search makes on a sorted array of 7 elements (counting one three-way comparison per probe)…
- The postfix expression 3 3 2 + 6 1 evaluates to:
- int f(int x){ return x ^ (x >> 1); } What does f(201) return? (This is the binary-reflected Gray code.)