Re: O() notation
O() gives you a measure of algorithmic efficiency. If you have an algorithm that is O(x), it is fundamentally more efficient than O(x^2). The actual values for the algorithms may be 1000x+1000 vs x^2, but after a while, the x^2 version still becomes worse. Algorithms are usually measured in efficiency against memory usage or speed. They are also sometimes rated against average and worst-case efficiency (quicksort has different values).
If you analyze the efficiency of your code, it will generally help you determine where to start making changes and what can be left alone.
|