5 ms·
For nearly sorted data, bubble sort is quite good. Simple implementation and near linear performance. Has my seal of approval.
by nothrabannosir 9y ago
For nearly sorted data, bubble sort is quite good. Simple implementation and near linear performance. Has my seal of approval.
- ufo 9y agoInsertion sort is almost always better isn't it?
- taneq 9y agoBubble 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.