Re:Big-O notation explained by a self-taught programmer
by kyllo on Saturday July 27, 2013 @10:27PM
(#6115344)
The definition of a "big" input size is somewhat circular, yes.
"The big O performance of an algorithm only matters for a sufficiently large value of n."
"Define a sufficiently large value of n."
"Large enough that the big O performance of the algorithm starts to matter more than the coefficients of n and constant time operations."
So yes, that could be 10 or 10 million depending on the nature of the problem, the constants and coefficients of the algorithm, the language, the hardware, etc etc. You could have an algorithm that takes factorial time but maybe you're only using it in a problem domain where n is always < 10 so you'll probably never notice or care that it's O(n!)
A good implementation could check problem sizes beforehand and chose the algorithm accordingly.
What I don't agree with is that "big O only matters for big input sizes". Big is not really a well-defined term. The problem here is that "big" depends entirely on the algorithms. It might also be n > 10. There's nothing in the definition of the landau symbols that prevents that.