I\'m trying to recall an algorithm on Fibonacci recursion. The following:
public int fibonacci(int n) { if(n == 0) return 0; else if(n == 1) ret
This kind of problems are linear recurrence types and they are solved fastest via fast matrix exponentiation. Here's the blogpost that describes this kind of approach concisely.