Jesus A. Gonzalez
July 17, 2019
\(T(n) = c_1 n + c_2 (n-1) + c_4(n-1) + c_5(n-1) + c_8(n-1)\) \(T(n) = (c_1 + c_2 + c_4 + c_5 + c_8)n - (c_2 + c_4 + c_5 + c_8)\)
\(T(n) = c_1n + c_2(n-1) + c_4(n-1) + c_5 \left( \frac{n(n+1)}{2} -1 \right)\) \(+ c_6 \left( \frac{n(n-1)}{2} \right) + c_7 \left( \frac{n(n-1)}{2} \right) + c_8(n-1)\)
\(T(n) = \left( \frac{c_5}{2}+\frac{c_6}{2}+\frac{c_7}{2} \right) n^2\) \(+ \left(c_1 + c_2 + c_4 + \frac{c_5}{2} - \frac{c_6}{2} - \frac{c_7}{2} + c_8 \right)n\) \(-(c_2 + c_4 + c_5 + c_8)\).