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 | jiangly | 3898 |
2 | tourist | 3840 |
3 | orzdevinwang | 3706 |
4 | ksun48 | 3691 |
5 | jqdai0815 | 3682 |
6 | ecnerwala | 3525 |
7 | gamegame | 3477 |
8 | Benq | 3468 |
9 | Ormlis | 3381 |
10 | maroonrk | 3379 |
# | User | Contrib. |
---|---|---|
1 | cry | 168 |
2 | -is-this-fft- | 165 |
3 | Dominater069 | 161 |
4 | Um_nik | 159 |
4 | atcoder_official | 159 |
6 | djm03178 | 157 |
7 | adamant | 153 |
8 | luogu_official | 150 |
9 | awoo | 149 |
10 | TheScrasse | 146 |
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