## Proof

- Suppose runtime is an2 + bn + c
- If any of a, b, and c are less than 0 replace the constant with its absolute value

- an2 + bn + c ? (a + b + c)n2 + (a + b + c)n + (a + b + c)
- ? 3(a + b + c)n2 for n ? 1
- Let c’ = 3(a + b + c) and let n0 = 1

- Suppose runtime is an2 + bn + c

## Question

- Is InsertionSort O(n3)?
- Is InsertionSort O(n)?

Previous slide | Next slide | Back to first slide | View graphic version |