Assume we do not know what the worst partition is.

T(n) = (T(q) + T(n-q)) + .

By the substitution method (since we know the answer), try T(n) *cn*^{2}.

= 2q - 2(n-q)
= 2q - 2n + 2q = 4q - 2n

.

For q=1: .

For q=n-1: .

T(n) c*n*^{2} - 2c(n - 1) + c*n*^{2}.
Picking a large enough c,

T(n) =