Professional Documents
Culture Documents
7 29 4 2 4 7 9
72 2 7 94 4 9
b if n 2
T (n)
2T (n / 2) bn if n 2
1 2 n2 bn
i 2i n2i bn
… … … …
I * J I h J h 2 n [( I h I l )( J l J h ) I h J h I l J l ]2 n / 2 I l J l
I h J h 2 n [( I h J l I l J l I h J h I l J h ) I h J h I l J l ]2 n / 2 I l J l
I h J h 2 n ( I h J l I l J h )2 n / 2 I l J l
So, T(n) = 3T(n/2) + n, which implies T(n) is O(n log23), by the
Master Theorem.
Thus, T(n) is O(n1.585).