2 ms·
Not sure if you noticed that's literally what they did at the end of the "Eigenvalue Solution" section, but it reads "So there you have it – a O(1) algorithm fo
by TheRealPomax 8y ago
Not sure if you noticed that's literally what they did at the end of the "Eigenvalue Solution" section, but it reads "So there you have it – a O(1) algorithm for any Fibonacci number."
Although they do note that eigen_fib() completely breaks down once the numbers involved are larger than fit in a 64 bit integer.
- jacobolus 8y agoThe previous commenter was criticizing https://www.nayuki.io/page/fast-fibonacci-algorithms https://www.nayuki.io/page/fast-fibonacci-algorithms (for not mentioning the supposedly O(1) solution) not http://www.oranlooney.com/post/fibonacci/ http://www.oranlooney.com/post/fibonacci/