how to solve T(n) = T(n-1) + nusing the Iterative method and answertheta(n^2)
T(n) = T(n-1) + n
theta(n^2)
T(n) = T(n-1) + n = T(n-2) + n-1 + n = ... = 1+ 2 + ... + n = (n+1)n/2 = theta(n^2)
Note the assumption that T (0) = 0 (you must have a base for recursion)I hope you had in mind
Sometimes you can also use the method of characteristic equations to solve recurrence relationships. This includes the definition of a particular integral and complete solution.
More information here: solving recurrence relationships