Computer Science EngineeringVery hard
The recurrence T(n) = T(sqrt(n)) + 1 has the solution
- A. Theta(log log n)
- B. Theta(log n)
- C. Theta(sqrt n)
- D. Theta(n)
Correct answer: A. Theta(log log n)
Taking square roots repeatedly reaches a constant after log2 log2 n steps.
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
- Prim's algorithm on a graph stored as an adjacency matrix with a simple array for minimum selection runs in
- The postfix form of the infix expression a + b c - d is
- The length of a longest common subsequence of ABCBDAB and BDCABA is
- The 0/1 knapsack problem with n items and capacity W is solved by dynamic programming in time
- A red-black tree with n internal nodes has height at most
- The Floyd-Warshall all-pairs shortest path algorithm runs in time