Multiple choice

The running time of an algorithm is represented by the following recurrence relation:

$T(n) = \begin{cases} n & n \leq 3 \\ T(\frac{n}{3})+cn & \text{ otherwise } \end{cases}$

Which one of the following represents the time complexity of the algorithm?

  1. $\Theta(n)$
  2. $\Theta(n \log n)$
  3. $\Theta(n^2)$
  4. $\Theta(n^2 \log n)$
Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

$= \theta(n)$