edited by
3,652 views
3 votes
3 votes

Can Extended Masters theorem be applied to the following recursive equation ?
$T(n)=n^{1/2}T(n^{1/2})+n$

I solved this using back substitution and the time complexity came out to be $O(n*(loglogn))$ 

I was wondering if this equation could be solved using masters theorem, like the way Tauhin Gangwar has solved here - https://gateoverflow.in/60532/find-tc-t-n-2t-n-1-2-1

edited by

1 Answer

Best answer
11 votes
11 votes
Yes, you can apply master's theorem, but you won't need to when you get to the right form.

Let $n = 2^{k}$. The recurrence becomes : $T( 2^{k}) = 2^{k/2}T( 2^{k/2}) + 2^{k}$. Now divide the entire equation by $2^{k}$. We get :

$T( 2^{k}) / 2^{k}= T( 2^{k/2})/2^{k/2} + 1$ Let $F(k) = T( 2^{k}) / 2^{k}$. Thus, what we have is: $F(k) = F(k/2) + 1$.

Apply master's theorem if you want but why even bother if you know what time is taken by binary search.Cheers.
selected by

Related questions

0 votes
0 votes
2 answers
2
manvi_agarwal asked Aug 10, 2018
1,762 views
Solution using back substitution methodT(n) = 2T(n/2) + nlogn ?detailed solution please.ans is nlognlogn or n(logn)^2
0 votes
0 votes
1 answer
3
Rahul Ranjan 1 asked Aug 6, 2018
1,660 views
How can we apply Masters theorem to these equations : T(n) = 16*T(n/4) + n!and T(n) = 4*T(n/2) + cnPlease explain the process.
0 votes
0 votes
1 answer
4
bts asked Jul 17, 2018
566 views
Solve by using master's theorem