Any help
F(n)=F(n-1)+F(n-2)+F(n-1)*F(n-2)
F[0]=a;
F[1]=b;
any logn solution ?
created
last reply
- 1
reply
- 1.1k
views
- 2
users
- 1
link
Any help
F(n)=F(n-1)+F(n-2)+F(n-1)*F(n-2)
F[0]=a;
F[1]=b;
any logn solution ?
use the matrix representation, this might help
http://www.geeksforgeeks.org/program-for-nth-fibonacci-number/17
and don't try to calculate the whole series just think about O(1) solution to find the sum
Topic | Category | Replies | Views | Activity |
---|---|---|---|---|
Hosting a competition on SPOJ | Off-topic | 1 | 79 | Apr 9 |