Big O notation

Big O notation is the mathematical notation used to express the limiting behavior of a function and is often used in the computer sciences to express the upper bound of an algorithm's runtime.

Example
var i, j; for(i = 0; i < n; i += 1) {  repeat(n) {    a = a + 1; } }

Consider the code above. We can see that each time it is called there will be n repetitions of the for loop and n repetitions of the repeat loop. This gives a total of n2 repetitions. In big O notation this function would be said to run in O(n2) time (also called "quadratic time"). Of course, the algorithm above can be expressed much more efficiently as: a = a + (n * n) which can be said to run in O(1) time or, "constant time." As you can see, this is quite an improvement.