c********p 发帖数: 1969 | 1 这题目到底有多少解法啊。。。
请教一下这个非recursion非iteration的解法是神马啊! |
x***4 发帖数: 1815 | 2 http://en.wikipedia.org/wiki/Fibonacci_number
Under the section of Matrix Form:
F_n = .....
Of course, I do not think a code farmer interview will ask for this formula.
Maybe the interviewer is looking for something else.
Good luck with your interview. |
c********p 发帖数: 1969 | 3 就是前几天在版上看谁的面经里提到的。。
formula.
【在 x***4 的大作中提到】 : http://en.wikipedia.org/wiki/Fibonacci_number : Under the section of Matrix Form: : F_n = ..... : Of course, I do not think a code farmer interview will ask for this formula. : Maybe the interviewer is looking for something else. : Good luck with your interview.
|
k**********y 发帖数: 20 | 4 用那个根号的公式,但是计算大数字时候有问题的。因为IEEE的浮点就是狗啊!!!!
!!
【在 c********p 的大作中提到】 : 这题目到底有多少解法啊。。。 : 请教一下这个非recursion非iteration的解法是神马啊!
|
c********p 发帖数: 1969 | 5 神马?
怎么做?
【在 k**********y 的大作中提到】 : 用那个根号的公式,但是计算大数字时候有问题的。因为IEEE的浮点就是狗啊!!!! : !!
|
b*********h 发帖数: 103 | |
s***e 发帖数: 403 | 7 Fibonacci的一个快速解法:矩阵
/ \
| 1 1 |
| 1 0 |
\ /
的n次幂。可以用分而治之处理。 |