Algorithms | Misc | Question 13

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
Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.