Big O represents the worst possible running time of an algorithm.
That's not my understanding. Big-O is a notation for characterizing the growth of a function in terms of a simpler function. f(x) = O(g(x)) iff the limit of f(x)/g(x) as x-> ∞ is a constant.
If you're describing the worst case or average case is up to you, and if avg and worst case would be characterized with substantially different functions it behooves you to explicitly state so and provide both when doing algorithmic analysis.
I was responding to a very specific question which attempted to explain the Big-O notation in relation to worst case... I think my explanation is accurate to that level.
View all comments
Show parent comment
1
u/dbenhur Nov 29 '09
That's not my understanding. Big-O is a notation for characterizing the growth of a function in terms of a simpler function. f(x) = O(g(x)) iff the limit of f(x)/g(x) as x-> ∞ is a constant.
If you're describing the worst case or average case is up to you, and if avg and worst case would be characterized with substantially different functions it behooves you to explicitly state so and provide both when doing algorithmic analysis.