Recurrence iteration method solve

71 Views Asked by At

hi i have this recurrence: how to solve? a) Solve the following recurrence using the iteration method and give an asymptotic running time: T(0)=0 and T(n)=10 +T(n-1), for n ≥ 1

1

There are 1 best solutions below

0
On BEST ANSWER

You can use dynamic programming technique to iteratively solve the problem:

define results[n+1];
results[0] = 0;

for (i = 1; i < n + 1 ) {
      set  results[i] to 10 + results[i-1] 
}

Tn = results[n];

Running time for the above algorithm will n.