## We say InsertionSort’s run time is O(n2)

- Properly we should say run time is in O(n2)
- Read O as “Big-O” (you’ll also hear it as “order”)

## In general a function

- f(n) is O(g(n)) if there exist positive constants c and n0 such that f(n) ? c ? g(n) for all n ? n0

## Formally

- O(g(n)) = { f(n): ? positive constants c and n0 such that f(n) ? c ? g(n) ? n ? n0

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