Consider the following C program for producing Fibonacci numbers:
int Fibonacci(int n)
{
if (n <= 0 || n == 1)
return 1;
else
return Fibonacci(n-1)+Fibonacci(n-2);
}
If for some large n, it takes 100 seconds to compute Fibonacci(n), how long
will it take to compute Fibonacci(n+1), to the nearest second?
F(n+1)=F(n)+F(n-1)
F(n+1)=1.62*F(n)
阅读(763) | 评论(0) | 转发(0) |