Solutions :
int fibo(int n){ // // using dynamic program int a=1, b=1, i, c; for(i=2; i>=n; i++){ c=a+b; a=b; b=c; } return a;}
its a better way to generate fibonacci numbers. it works within the time limit of O(n)
its a better way to generate fibonacci numbers. it works within the time limit of O(n)
ReplyDelete