There is no sorting algorithm that is O(n log n) in time, O(1) in space and also stable. Pick your poison.
miniblog.
Related Posts
The examples coverage in Rust is exceptionally good. It's weird how few languages include an example in their stdlib docs for sorting.
Design principles for autocomplete: https://jeremymikkola.com/posts/2019_03_19_rules_for_autocomplete.html
(I've read persuasive defences of sorting autocomplete more intelligently than alphabetically. Nonetheless, the articles lists a ton of great heuristics.)
I'm comfortable choosing sorting algorithms for a computer. Choosing a sorting algorithm for a human seems much harder.
For example, suppose you want to sort a shuffled deck cards. Quicksort seems too fiddly for a manual process with a relatively small (52) quantity.
