I am having trouble understanding how to solve a recurrence relation. If you can please help walk me through this one:
$T(n) = T(\dfrac{n}{2}) + 5$
Initial conditions $T(0) = 0$ and $T(1) = 1$
My teacher did not explain this very clearly and I'm very confused on where to begin..if someone can please point me in the right direction, don't necessarily need to solve.
From looking at the internet, I believe this relation is non-homogenous because of the $5$, so would the first step be to solve the homogenous equation and then add the $5$?
The problem with your formula is with the $n/2$; in general, to calculate $T(n)$ defined by recurrence (i.e.in terms of (one or more) values of $T(k)$ with $k < n$) you must substitute into the formula for $T(n)$ the formula for $T(n-1)$, and so on, until you reach (after a finite number of steps) the "base" case, i.e. $T(1)$ or $T(0)$.
In your problem, starting for example with $T(5)$, we need $T(5/2)$, but in this way we cannot reach $T(1)$ or $T(0)$.
The problem is easy if we may assume - as suggested by @lhf - that $n$ is a power of $2$.
In this case $T(4) = T(2) + 5 =(T(1) + 5) +5 = (1 + 5) + 5 = 11$, and so on : $T(8) = T(4) + 5 = 16$ ...
I suppose that your question is an application of the Master theorem.
We are in the Case 2 : where $f(n) = 5 = \Theta (n^c log^k n)$, with $c=0$ and $k=0$.
From : $T(n) =T(n/2)+5$, we have $a=1$ and $b=2$, so that $\log_2 1 = 0$ and $c = 0 = log_2 1$.
It follows that $T(n) = \Theta(f(n)) = \Theta(n^clog^{k+1} n) = \Theta(log(n))$.