Search code examples
recursionruntimecomplexity-theory

Solve the recursively defined function


Find the run-time complexity of the recursively defined function T(n) = T(n-1) + 3. I am completely lost on how to do this.


Solution

  • In this type of recursions you can apply the muster theorem: https://www.eecis.udel.edu/~saunders/notes/recurrence-relations.pdf

    In your case b = a = 1 and d = 0, therefore the complexity if O(n).