2 2 votes Running time of an algorithm $T(n),$ where $n$ is input size is given by $T(n) = \begin{cases} 8 T(n/2) + qn, & \textsf{ if } n>1 \\ p, & \textsf{ if } n=1 \end{cases}$ where $p$ and $q$ are constants. $T(n)$ is $\Theta(n^2)$ $\Theta(n^n)$ $\Theta(n^3)$ $\Theta(n)$ Algorithms algorithms recurrence-relation + – Purple 3.3k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
Best answer 4 4 votes Case 1 of master theorem as $f(n) = O\left(n^{\log_b a -\epsilon} \right ) \\= O\left(n^{\log_2 8 -\epsilon }\right) \\= O\left(n^{3 -\epsilon} \right)$ is true for any $ 0 < \epsilon \leq 2$. Now, the complexity is $\Theta\left(n^{ \log_b a }\right) = \Theta \left(n^3\right)$. Arjun answered Jan 22, 2016 • selected Jan 22, 2016 by Pooja Palod Arjun comment Share Follow 0 reply Please log in or register to add a comment.