Posted by: atri | October 18, 2012

## Typo in solution to Q1 on HW 3

In the proof of the analysis, on the 3rd line in 2nd para it says

$T(n)=\sum_{i=1}^n n\times (n-i + O(n-i))=O(n^2)$.

That is a typo and it should read

$T(n)=\sum_{i=1}^n (n-i + O(n-i))=O(n^2)$.

The last equality uses the following identity

$\sum_{j=1}^n j =\frac{j(j+1)}{2}$.

Thanks to the student who pointed out the bug!