What would you like to Propose?
Golden ration formula
Problem statement : Find the nth Fibonacci number in O(1) time complexity.
Algorithm :
We can simply use the formula given below to find Nth Fibonacci number.
1/√5 * (0.5 * (( √5 + 1) ^ n) - (0.5 * ( 1 - √5) ^ n))
Issue details
So, the algorithm just uses formula for finding Nth Fibonacci number in O(1).
Additional Information
No response
What would you like to Propose?
Golden ration formula
Problem statement : Find the nth Fibonacci number in O(1) time complexity.
Algorithm :
We can simply use the formula given below to find Nth Fibonacci number.
1/√5 * (0.5 * (( √5 + 1) ^ n) - (0.5 * ( 1 - √5) ^ n))
Issue details
So, the algorithm just uses formula for finding Nth Fibonacci number in O(1).
Additional Information
No response