In: Computer Science
Use the recursion tree method to determine the asymptoticupper bound of T(n).T(n) satisfies the recurrence T(n)=2T(n-1)+ c, where c is a positive constant, andT(0)=0.
T(n) = 2T(n-1) + c
T(n) c ^
/ \ |
T(n-1) T(n-1) 2c
/ \ / \ n
times
T(n-2) T(n-2) T(n-2) T(n-2)
4c
. |
.
. |
T(0) T(0) ..... T(0) V
c c ..... c
T(n) = c + 2c + 4c + 8c ..... 2nc
= c( 1 + 2 + 4 +8 ... n times) // sum of geometric progresssion
with a = 1 and r = 2
= c * 2n+1
T(n) = O(2n)