由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Quant版 - [合集] 另一道题(C++)
相关主题
[合集] 终于等到brett jiu的书ComputerScience里面的经典问题
Sales job openinghelp~~~~~~~question about sony computer
像这种面试题应该如何思考和回答呢?[合集] 苹果知名度不行啊
牛逼请进Ask for data (转载)
Fibonacci number interview questions?Ask for data
请教一个DP的题Ask for data (转载)
help for running CPU intensive program!!Q in C/C++
【2018年2月第8,9绿】2018年2月第8/9绿 RD 05/2017 NSCC++ linux 线程面试题
相关话题的讨论汇总
话题: fibonacci话题: mar话题: thu话题: c++话题: compute
进入Quant版参与讨论
1 (共1页)
b***k
发帖数: 2673
1
☆─────────────────────────────────────☆
crazystones (黑皮) 于 (Thu Mar 13 22:38:26 2008) 提到:
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?
☆─────────────────────────────────────☆
karon (卡龙) 于 (Thu Mar 13 22:47
s*******e
发帖数: 432
2
T(n) = T(n-1) + T(n-2)--->
T(n)/T(n-1) = 1 + 1/(T(n-1)/T(n-2));
define Rn= T(n)/T(n-1)
Rn= 1 + 1/R(n-1)
Notice the limit exist=x
so one solve the following equation and pick the larger than 1 one:
x = 1 + 1/x
x= 1/2(1 + sqrt(5))
1 (共1页)
进入Quant版参与讨论
相关主题
C++ linux 线程面试题Fibonacci number interview questions?
发7道变态码工题,大家帮忙解解,3包子一题请教一个DP的题
nvidia面筋help for running CPU intensive program!!
招聘:Python Engineer-Contract Position in Bellevue【2018年2月第8,9绿】2018年2月第8/9绿 RD 05/2017 NSC
[合集] 终于等到brett jiu的书ComputerScience里面的经典问题
Sales job openinghelp~~~~~~~question about sony computer
像这种面试题应该如何思考和回答呢?[合集] 苹果知名度不行啊
牛逼请进Ask for data (转载)
相关话题的讨论汇总
话题: fibonacci话题: mar话题: thu话题: c++话题: compute