How to implement Fibonacci algorithm in two ways in C++?
I mean I wan to implement Fibonacci algorithm in both divide and conquer(D&C) method and dynamic programming and finally extract time complexity of both methods and compare the complexities and choose one of them.please guide me.

Akhil GargPosted Apr 19, 2015, 12:48 PM
Accept the answer if it solved your problems. . :)
Joe WilsonPosted Apr 19, 2015, 12:14 PM
Akhil GargPosted Apr 18, 2015, 2:22 AM
http://www.c-program-example.com/2011/10/c-program-to-implement-floyds-algorithm.html
Akhil GargPosted Apr 18, 2015, 2:19 AM
Joe WilsonPosted Apr 18, 2015, 2:07 AM
Akhil GargPosted Apr 17, 2015, 3:22 PM
if you got ur answer accept answer.
Joe WilsonPosted Apr 17, 2015, 2:59 PM
Akhil GargPosted Apr 17, 2015, 2:38 PM
Akhil GargPosted Apr 17, 2015, 2:36 PM
using namespace std;
int main()
{
int i=1; int j=0; int k=0; int h=1; int t=0; int n;
cin>>n;
while (n)
{ if (n%2)
{ t=j*h; j=i*h+j*k+t; i=ik+t; }
t=h*h; h=2*k*h+t; k=k*k+t; n=n/2; }
cout<<j;
return 0; }
Joe WilsonPosted Apr 17, 2015, 2:12 PM
Akhil GargPosted Apr 17, 2015, 4:38 AM