Choosing a sort comes down to a few properties: time complexity, stability, in-place memory use, and the nature of the data. No single sort wins everywhere.
Key properties
- Stable: equal elements keep their original relative order (needed for multi-key sorts).
- In-place: uses O(1) or O(log n) extra memory.
- faster on nearly-sorted input.
