Can someone please help me to solve this using recursion tree method, I am trying it but unable to solve it. T(N) = sqrt( N ) T( sqrt( N ) ) + sqrt( N )
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 151 |
Name |
---|
On each level of recursion tree the total work is n^(1-1/2^(i+1)) -on the 0 level you have n^(1/2) -on the 1 level you have n^(1/2) calls with work sqrt(n^(1/2)) = n^(1/2+1/4) -on the 2 level you have n^(1/2) call from 0->1 and n^(1/4) from 1->2, each with work n^(1/8) = n^(1/2+1/4+1/8) and so on...
Depth of the recursion tree is log long n So the total work is sum_{i=0}^{log log n} n^(1-1/2^(i+1)) which is O(n log log n). The exact value is https://www.wolframalpha.com/input/?i=sum+from+0+to+%28log+log+n%29+n%5E%281-%281%2F2%29%5E%28i%2B1%29%29