T(n) = 2*T(n/2) + n*log(n)
I tried to solve it using master method but it doesn't seem to fit any of the three cases.
Am I correct.?
# | 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 | 150 |
Name |
---|
T(n) = 2*T(n/2) + n*log(n)
T(n) = 4*T(n/4) + n*log(n/2) + n*log(n)
T(n) = 8*T(n/8) + n*log(n/4) + n*log(n/2) + n*log(n)
...
So we can see the sum is of order n*log2(n).
The very question has been explained. Its mentioned that:
"The master method does not apply to the recurrence
T(n) = 2T(n/2) + n lg n,
even though it has the proper form: a = 2, b = 2, f(n) = n lg n, and . It might seem that case 3 should apply, since f(n) = n lg n is asymptotically larger than . The problem is that it is not polynomially larger. Consequently, the recurrence falls into the gap between case 2 and case 3 of master theorem."
The recurrence relation is n*(log 2n)
And the assumption that the gap between case 2 and case 3 is dependent on k isn't correct if I have understood you properly. The generalisation I mentioned only applies to cases when f(n) = Θ(nlogbalogkn) and doesn't cover other variants of f(n) being not asymptotically equal to nlogba and neither polynomially larger nor polynomially smaller.