Hacker News new | ask | show | jobs
by professoretc 1036 days ago
For 30 items bubblesort might very well have been faster than mergesort.
2 comments

Bubble/selection sort with early exit can win outright on big lists if they're already almost in order. Textbook example years ago was cheque numbers which mostly are presented in order.

Know your data. (Which in this case, i don't).

But it always loses to insertion sort.