retagged by
550 views

2 Answers

3 votes
3 votes
In such questions, to take advantage of Master Theorem, we need to reduce the recurrence into some other form to which Master Theorem is applicable.

Given, $T(n) = 2T(\sqrt{n}) + c$

Put $n = 2^{m}$  in the equation

$T(2^m) = 2T(2^{m/2}) + c$

Now let's assume $P(m) = T(2^m) $

So, recurrence becomes $P(m) = 2P(\frac{m}{2}) + c$

Now, applying Master Theorem to this recurrence, we get

$P(m) = \theta (m^{log_{2}2}) = \theta(m)$

 

So, $T(2^m) = P(m) = \theta(m) $

Substituting for m, $m = log_{2}n$

$T(2^{log_{2}n}) = \theta(log_{2}n) $

which implies that $T(n) = \theta(log_{2}n) $

Related questions

1 votes
1 votes
0 answers
1
syncronizing asked Mar 15, 2019
1,325 views
Is this the correct way to solve ?Q) int algorithm(int n){ int sum =0;k,j; for (k=0;k<n/2;k++) for(j=0;j<10;j++) sum++; return 4*algorithm(n/2)*algorit...
1 votes
1 votes
1 answer
2
VikramRB asked Jan 20, 2019
1,053 views
What is the time complexity of the following recurrence relation and step to derive the same$T(n) = T(\sqrt{n}) + log(logn)$
0 votes
0 votes
0 answers
4
garvit_vijai asked Nov 17, 2018
476 views
How to solve the following recurrence relation?T(n) = T(n-6) + n2 , n>7T(n) = 1 , n<= 7