Can someone please help me with this ?
Use iteration method to solve it. T(n) = T(n-1) +n
Explanation of steps
Expand it!
T(n) = T(n-1) + n = T(n-2) + (n-1) + n = T(n-3) + (n-2) + (n-1) + n
and so on, until
T(n) = 1 + 2 + ... + n = n(n+1)/2 [= O(n^2)]
provided that T(1) = 1
T(1) = 1