• retagged by
1,629 views

2 Answers

Best answer
4 4 votes
$\color{olive}{T(n) = 2T(\sqrt{n}) + log(n)}$

Let $\color{navy}{n = 2^m}$, and putting this in above recurrence relation.

$T(2^m) = 2T(2^{\frac{m}{2}}) + m$

Let, $S(m) = T(2^m)$, then, $S(\frac{m}{2}) = T(2^\frac{m}{2})$

$S(m) = 2S(\frac{m}{2}) + m$

This is similar to Merge-Sort (or) using master's theorem, it can be said that $S(m) = O(mlog_{2}(m))$

Now. replacing $m$ by $log_{2}(n)$, $\color{red}{T(n) = O(log_{2}(n)log_{2}log_{2}(n))}$
• selected by
3 3 votes
$\color{red}{T(\sqrt{n})}$ always gives us $\log \log n $ level in the recursion tree and in this particular question each level has equal work which is $\log n$.

Total work = net complexity = $\log n . \log \log n$ = $O(\log n . \log \log n)$
• edited by
Position:
Show:

Related questions

2 2 votes
2 2 answers
2.7k
2.7k views
iarnav asked Apr 3, 2018
2,650 views
Solution to the Recurrence equation $T(n) = T(n/5)+T(7n/10)+O(n)$ is
0 0 votes
1 1 answer
434
434 views
Amoljadhav asked Mar 1, 2024
434 views
how many spanning trees are possible for complete graph of 4 vertices
0 0 votes
0 0 answers
1.5k
1.5k views