3 ms·
My rule is that the only sort I will ever write by hand is a bubble sort. It's basically impossible to write incorrectly. If and when that breaks performance,
by jdmichal 6y ago
My rule is that the only sort I will ever write by hand is a bubble sort. It's basically impossible to write incorrectly. If and when that breaks performance, then I will bring in an external sorting library and figure out what works the best for the data.
It's the equivalent philosophy to always buying the cheapest tool you can the first time around. When you break that tool, then you go out and buy the expensive one.
- deleted 6y ago[deleted]
- rgossiaux 6y agoThe cheapest tool you can find is surely the sort in your programming language's standard library. Writing your own sort seems crazy to me.
- jdmichal 6y agoWhat can I say. Sometimes you're not working with the blessed standard data structures for which those algorithms are typically written.