Hello I am trying to understand this recurrence equation with no success.
$ T(n) = T(n / 2) + θ(1)$
Base case : $T(1) = θ(1)$
and the solution is $θ(log_2 n)$.
What does $θ(1)$ stand for and why is the solution $θ(log_2 n)$?
Hello I am trying to understand this recurrence equation with no success.
$ T(n) = T(n / 2) + θ(1)$
Base case : $T(1) = θ(1)$
and the solution is $θ(log_2 n)$.
What does $θ(1)$ stand for and why is the solution $θ(log_2 n)$?
So θ$(1)$ is a constant amount of time. Let's rename it as $k$ for simplicity's sake.
So let's now say $ n = 2^q $ (which equals to $q = log2(n)$), then we have: