Hacker News new | ask | show | jobs
by david-gpu 16 days ago
It has some redeeming qualities.

I would guess its running time is as consistent as the memory hierarchy allows. Having tight bounds on execution can be valuable in real time systems.

Simple to verify that the implementation is correct. Simple to implement in assembly.

Could be worse! I still prefer bogosort.

1 comments

It has some cache locality that may make it beat smarter algorithms for certain arrays. For example, it can perform a lot of swaps while an O(n log n) algorithm is waiting for data to be fetched from memory.

Of course, an O(n log n) algorithm can also be optimized for cache locality.