Big O (Example)
Let f(n) = n(n-1)/2 and g(n) = n2
Then f(n) is O(g(n)) because we can take
c = 1 and n0 = 0, and then
(?n > 0)
f(n) = n(n-1)/2 = ½ n2 - ½ n ? 1 ? n2 = g(n)
Previous slide
Next slide
Back to first slide
View graphic version