retagged by
8,384 views
1 votes
1 votes

How to find time complexity of fibonacci series ? Answer is given O (2^n). But i couldn't get it

Recurrence eq :

        T(n) = T(n-1) + T(n-2) + c.

By back substitution i got,

T(n) = T(n-1) + T(n-2) + c
T(n) = 2*T(n-2) + T(n-3) + 2c
T(n) = 3*T(n-3) + 2*T(n-4) + 4c
T(n) = 5*T(n-4) + 3*T(n-5) + 7c
etc ...

 I'm unable to proceed to next steps..

After that what would be the procedure? 

Could anyone please explain?

retagged by

1 Answer

Best answer
2 votes
2 votes
$T(n) \leq 2T(n-1)$

Solving we get.

$\Rightarrow T(n) = O(2^{n})$
selected by

Related questions

3 votes
3 votes
1 answer
1
sumit_kumar asked Jun 25, 2017
3,140 views
what is time comlexity procedure for following recursive equation by substitution method:T(n)= T(n-1)+T(n-2) , if n>=2 =1 , if n=1; =0 , if n=0.
2 votes
2 votes
2 answers
3
pradeepchaudhary asked Jul 14, 2018
9,189 views
Q.6 The time complexity of an algorithm T(n), where n is the input size, is given by— T(n)= T(n-1) + 1/n, if n>1 = 1, otherwise.The order of the algorithm is�...