I'm having a real hard time solving recurrences using the substitution method.
Show that: $T(n) = T(n/2) + 1$ is $O(\lg n)$
I thought this to be relatively easy:
We have to show that $T(n) \leq c \lg n$
Substitution gives me:
$\qquad \begin{align} T(n) &\leq c \lg(n/2) + 1 \\ &= c \lg n - c \lg 2 + 1 \\ &= c \lg n - c + 1 \\ &\leq c \lg n \end{align}$
for every c.
I was under the impression this was it, but when I was looking for an answer, I came around a much more elaborate answer on the web, given involving subtracting a constant. I don't get why that's needed, I thought I had shown what was needed.
Any help would be greatly appreciate, starting Monday I'm enrolled in an algorithms class and I don't want to get behind!
We are using the CLRS book (surprise) and though I appreciate the amount of information in it, I'd rather have some more resources. I've really enjoyed a datastructures class and I really think I can enjoy this as well, but more resources would be very much appreciated.