retagged by
1,625 views
4 votes
4 votes
What will be time complexity for both recurrences?

$$T(n) = \begin{cases}
2 \cdot T \left ( \sqrt n \right ) + \log n & \text{if } n > 4\\[1em]
1 & \text {if } n \leq 4
\end{cases}$$

$$T(n) = \begin{cases}
2 \cdot T \left ( \sqrt n \right ) + \frac{\log n}{\log \log n} & \text{if } n > 4\\[1em]
1 & \text {if } n \leq 4
\end{cases}$$
retagged by

1 Answer

Best answer
2 votes
2 votes

1) T(n) = 2T(n1/2) + logn

   T(2m) = 2 T(2m/2) + m

S(m) = 2S(m/2) +m

putting in formula mlog2= m

So, complexity will be m log1m = logn loglogn = O(logn. log2n)

2) T(n) = 2T(n1/2) + (logn / loglogn)

   T(2m) = 2 T(2m/2) + m/logm

S(m) = 2S(m/2) + m/logm

Complexity will be O(logn. log3n)

selected by

Related questions

0 votes
0 votes
1 answer
1
shashi111 asked Aug 27, 2017
526 views
Consider the following recurrence.T(n) = T() + What is the value of recurrence?please explain in detail
0 votes
0 votes
1 answer
2
Hardik1997 asked May 20, 2017
364 views
1 :- T(n) = T(n-2) + n22 :- T(n) = 4T(n/3) + nlgn3 :- T(n) = 3T(n/3 - 2) + n/2
2 votes
2 votes
2 answers
3
Regina Phalange asked Mar 4, 2017
3,028 views
What is the value of following recurrence.T(n) = T(n/4) + T(n/2) + cn^2 T(1) = c T(0) = 0Where c is a positive constantA) O(n^3)B) O(n^2)C) O(n^2logn)D) O(nlogn)
1 votes
1 votes
1 answer
4
Aspi R Osa asked Dec 14, 2015
509 views
Do they differ or are they same?they are confusing me/