Hacker News new | ask | show | jobs
by phoenixreader 1032 days ago
According to the Twitter thread linked, at the beginning there were only 30 items, so using bubblesort didn't matter. The number of items has since grown to a thousand.
1 comments

For 30 items bubblesort might very well have been faster than mergesort.
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.