Solve the following recurrence:
$$\ T(n) = \sqrt{n}\cdot T(\sqrt{n}) + n\cdot \log(n)$$
I tried to just unroll it to see if I can understand, but it is too complicated .
$\ T(n) = n^{\frac{1}{2}} \cdot T(n^{\frac{1}{2}}) +n\cdot \log(n)\\ = n^{\frac{1}{2}} \cdot \left( n^{\frac{1}{4}} \cdot T(n^{\frac{1}{4}} ) + \frac{n}{2} \cdot \log(\frac{n}{2}) \right) + n \cdot \log(n) \\ = n^{\frac{1}{2}} \left( n^{\frac{1}{4}} \cdot \left( n^{\frac{1}{8}} \cdot T(n^{\frac{1}{8}}) + \frac{n}{4}\cdot \log(\frac{n}{4}) \right) + \frac{n}{2} \cdot \log(\frac{n}{2}) \right) + n\cdot \log(n) $
Not really clear how to proceed here? I also tried recurrence tree, but couldn't see a clear pattern. I've found a similar question here but I could not understand the answer
I find this answer much more simpler and efficient
This is my attempt:
$T(n) = \sqrt{n} T(\sqrt{n}) + n \log n$
First a change of variable $n = 2^k$ leading to:
$T(2^k) = 2^{k/2} T(2^{k/2}) + k 2^k$
Now a change of function: $T(2^k) = S(k)$, leading to:
$S(k) = 2^{k/2} S(k/2) + k2^k$
Unfortunately we cannot apply Master theorem on this because of the non-constant multiplier $2^{k/2}$.
Instead we have to expand this using repeated substitution:
$S(k) = 2^{k/2 + k/4 + \ldots + k/2^d}T(k/2^d) + k/2^d 2^{k/2^d} + \ldots + k2^k$
where $d$ is the depth of this tree. It is decided by the base case. You haven't mentioned a base case but assuming it's a constant, we can say $k/2^d = B$ and T(B) = C, whee $B,C$ are constants:
$S(k) = 2^{k/2 + k/4 + \ldots + k/2^d} C + k/2^d 2^{k/2^d} + \ldots + k2^k$.
The first term is 2 powered to a decaying GP series. The second term is a AGP series.
The GP series converges to $2$ (thus the $2^2C$ can be ignored for asymptotic bounds). The AGP series is equal to $(k^2)^k + 2^{k/4 - 2} k + 2^{k/2 - 1} k$.
We can now move back to the original variable $n$: $\Rightarrow ((\log n)^2)^{\log n} + 2^{(\log n)/4 - 2} \log n + 2^{(\log n)/2 - 1} \log n$
$\Rightarrow ((\log n)^{2\log n} + 2^{(\log n)/4 - \log 4} \log n + 2^{(\log \sqrt{n}) - \log 2} \log n$
$\Rightarrow ((\log n)^{2\log n} + 2^{(\log n^{1/4}/4} \log n + 2^{\log \sqrt{n}/2 } \log n$
$\Rightarrow ((\log n)^{2\log n} + n^{1/4} \log n /4 + \sqrt{n} \log n/2 $