edited by
549 views

2 Answers

Best answer
4 votes
4 votes

This is one of the method for solving this question

selected by
2 votes
2 votes
$T(n) = \sqrt{n}*T(\sqrt{n}) + n$

Dividing both sides by $n$, we get

$\frac{T(n)}{n} = \frac{T(\sqrt{n})}{\sqrt{n}} + 1$

Now, let $S(n) = \frac{T(n)}{n}$

So, the recurrence equation boils down to

$S(n) = S(\sqrt{n}) + 1$

Let, $n = 2^{k}$

So, $S(2^{k}) = S(2^{\frac{k}{2}}) + 1$

Again, let $H(k) = S(2^{k})$

So, $H(k) = H(k/2) + 1$

Solving the equation by master theorem, we get

$S(2^{k}) = H(k) = logk$

Now, since $n = 2^{k}$, $k = logn$

So, $S(n) = loglogn$

Since, $S(n) = \frac{T(n)}{n}$,

$T(n) = nS(n)$

$T(n) = nloglogn$

Related questions

0 votes
0 votes
1 answer
1
Çșȇ ʛấẗẻ asked Mar 14, 2023
423 views
Solve the following recurrences using recursion tree method and write the asymptotic time complexity T(n)=T(n/2)+n^2
0 votes
0 votes
1 answer
2
abhinav dongre asked Nov 11, 2021
372 views
T(n)= T(n/3)+T(n/4)+5n , T(1)=c. Find solution using tree method.
0 votes
0 votes
1 answer
3
_Madhuri asked Nov 2, 2021
326 views
What will be the recurrence relation for max heapify. Please explain with example.
1 votes
1 votes
0 answers
4
srestha asked May 19, 2019
633 views
Let $A(n)$ denotes the number of $n$ bit binary strings which have no pair of consecutive $1’s.$ what will be recurrence relation for it and what will be it’s Time Co...