I'm solving some recurrence relation problems for Big O.
T(n) = T(n-1)
I started with:
T(n) = T(n-1)
T(n-1) = T(n-2)
..
T(n) = T(n-k)
Now setting k to n-1
T(n) = T(1)
So the result is
T(n) = O(1)
I'm not entirely sure if this is correct, but I'm uncertain that this is so easy.
As long as you have a base case, yes, that's correct.
I'm assuming the recurrence is defined as
T(0) = k (for some constant k), and
T(n+1) = T(n)
Then you can prove by induction that T(n) = k for all natural numbers n.
Therefore, T(n) = k = O(1).
Hope this helps!