Examples of O-notation
42 = O(1)
3n + 42=O(n)
5n2 – 3n + 7 = O(n2)
12 + 22 + … + n2 = n3/3 + n2/2 + n/6
= O(n3)
Loosely: Pick the fastest growing term and discard constant multiples
Previous slide
Next slide
Back to first slide
View graphic version