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