Not sure how to prove this since there's no cost associated with each recursion.
Asked
Active
Viewed 20 times
1 Answers
1
You can always just find a closed-form solution, especially when the recurrence is this simple. Observing that $T(0) = c, T(1) = 2c, T(2)=4c, \cdots,$ we can see that $T(n) = c \cdot 2^n$, for some constant $c$, and thus, this relation grows with $2^n$, i.e. it is $\Theta(2^n)$.
paulinho
- 6,553
-
Wow, thanks!!!!! – A_for_ Abacus Jun 24 '19 at 17:24