4 ms·
Any comparison based sorting algo can be made stable. Consider position as a tie breaker. Most can be done in place with some effort. Then you need to worry n
by SideQuark 4y ago
Any comparison based sorting algo can be made stable. Consider position as a tie breaker.
Most can be done in place with some effort.
Then you need to worry not about asymptotics, but the constant factors. Quicksort has significantly lower operation count than heap sort, even though both are O(nlog n). For small numbers bubble sort is quicker than both (and many good sorts leverage this via hybrid methods). Caches add another massive game changing performance dial to fiddle with.
Taking stock at this level, ignoring that many of the non-green field he chose can be made green, misses important nuance.