Single Choice Easy

QWhat is the time complexity of the dynamic programming algorithm for computing the nth Fibonacci number?

ID: #5717 Dynamic Programming 172 views
Question Info
#5717Q ID
EasyDifficulty
Dynamic ProgrammingTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A O(n)
  • B O(log n)
  • C O(n^2)
  • D O(2^n)
Correct Answer

Explanation

Answer: O(n)

Explanation: The dynamic programming algorithm for computing the nth Fibonacci number has a time complexity of O(n) because it involves solving a linear number of subproblems.

Share This Question

Challenge a friend or share with your study group.