Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Big-O isn't related specifically to sorting - it refers to the standard notation for stating the order of an algorithm.
Apparently there are people out there claiming to be software developers who don't know what expressions like O(n) and O(n*log(n)) actually mean. These are the people who merrily implement algorithms of order n-squared-squared and then can't understand why it takes a millisecond on their useless little test database of ten random numbers, but needs until the heat death of the Universe on live data
There's nothing wrong with my favourite bubble sort...
There's nothing wrong with my favourite bubble sort...
Of order n-squared - yet it can (theoretically) be a usable solution when it's known that the dataset is already very close to being sorted.
However, due to the fact that it causes a large number of cache misses and branch mispredictions on modern CPUs, it's still not a great choice - if an algorithm of n-squared complexity is acceptable, then insertion sort will perform considerably better.
Comment