Skip to content
Related Articles

Related Articles

Algorithms | Misc | Question 13

View Discussion
Improve Article
Save Article
  • Last Updated : 28 Jun, 2021
View Discussion
Improve Article
Save Article

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 :

Start Your Coding Journey Now!