1. O(n) additions and O(n2) comparisons
  2. 1 + 2 + 3 + 4+…+ n < n + n + n + … n because 1 < n, 2 < n …

Therefore 1 + 2 + 3 + 4+…+ n < n 2

Let f(n) = 1 + 2 + 3 + 4+…+ n and g(n) = n 2 .

Then there is a constant c  = 1 and n0 where f(n) < c * g(n) for n > n0

Thus f(n) = O(g(n))