What is the most efficient way to calculate Fibonacci. Is it recursion with memorization, is it iteration or is there another approach?

The Binet formula, nearest integer to φ^{n}/sqrt(5)

Or you could calculate integer power of the 2x2 matrix {{1,1},{1,0}} (it's a O(log n) operation)

Or you could calculate integer power of the 2x2 matrix {{1,1},{1,0}} (it's a O(log n) operation)

Last edited on

Topic archived. No new replies allowed.