Recursive squaring algorithm to compute fibonacci numbers
Answers
Answered by
0
Do you mean this:
long fib(int n){
return !(n == 0 || n == 1) ? fib(n-1) + fib(n-2) : n;
}
long fib(int n){
return !(n == 0 || n == 1) ? fib(n-1) + fib(n-2) : n;
}
Similar questions