All mock tests are FREE till 31 December — register to save your progress

Match List I with List II
List IList II
A. Running time of a straightforward recursive method to compute the nth Fibonacci number FₙI. O(n²)
B. Running time to compute Fₙ using memoizationII. O(log n)
C. Running time to compute Fₙ using only integer addition and multiplicationIII. O(n)
D. Running time to determine an optimal bitonic tourIV. Θ(φⁿ)

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. A-IV, B-III, C-II, D-I

Explanation

The naive recursive Fibonacci runs in Θ(φⁿ) (IV). With memoisation it is O(n) (III). Using only integer addition and multiplication (matrix powering) it is O(log n) (II). The optimal bitonic tour DP is O(n²) (I).

More Data Structures and Algorithms questions