Re:“It is never a compiler error”
by nothrabannosir on Tuesday November 14, 2017 @05:33PM
(#15699842)
For nearly sorted data, bubble sort is quite good. Simple implementation and near linear performance. Has my seal of approval.
[ Parent
| on HN ]
Insertion sort is almost always better isn't it?
Bubble sort is also good for keeping a list close-enough-to-sorted with only small incremental costs. It was an old graphics engine trick to run just a few passes of bubblesort over your sorted triangles array before rendering each frame. Occasionally you'd get artifacts but generally it worked well enough and was fast.