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 )
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
Название |
---|
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