Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the time complexity of the recurrence T(n) = 2T(n-1) + 4

What is the time complexity of the recurrence T(n) = 2T(n-1) + 4 ?

I'm having serious problems with this. I tried:

T(n) = 2T(n-1)+4 = 2(2T(n-2)+4)+4 = 4T(n-2)+12= 4(2T(n-3)+4)+4 = 8T(n-3)+20 = 8(2T(n-4)+4)+4 = 16T(n-4)+36 =…

T(n) = 2^kT(n-k) + (4+2^(k+1))

so it looks like T(n) = 2^n + (4+2^(n+1)) but it doesn't seem right... please help :(

like image 514
CnR Avatar asked Dec 13 '25 23:12

CnR


1 Answers

Solving the recurrence relation, I found this:

enter image description here

like image 53
Mohamed Ennahdi El Idrissi Avatar answered Dec 15 '25 18:12

Mohamed Ennahdi El Idrissi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!