4 ms·
http://en.wikipedia.org/wiki/Big_O_notation http://en.wikipedia.org/wiki/Big_O_notation - see "formal definition". The core of it is one sentence in english, an
by 10098 13y ago
http://en.wikipedia.org/wiki/Big_O_notation http://en.wikipedia.org/wiki/Big_O_notation - see "formal definition". The core of it is one sentence in english, and it's even shorter if you choose to use only mathematical notation.
All you need to know in the context of applying this to algorithms is that there has to be some notion of "size" for the problem, and the time it takes for the algorithm to complete is a function of that size.
Once you internalize that, understanding complexity analysis will be much easier. You don't have to memorize complexities of common algorithms.
I'm not really sure why it's so difficult to wrap your head around this concept, but apparently it is difficult. This is the second time I'm seeing this link on HN in the past month, I think.