Skip to content
Related Articles

Related Articles

Improve Article

Algorithms | Misc | Question 13

  • Last Updated : 28 Jun, 2021
Geek Week

Which of the following is the best possible time complexity to get Nth Fibonacci number with O(1) extra space
(A) Time complexity T(n) is T(n-1) + T(n-2) which is exponential
(B) O(n)
(C) O(Logn)
(D) O(n^2)

Answer: (C)

Explanation: The best possible time complexity is O(Logn). See Program for nth Fibonacci number

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :