Merge Sort vs Quick Sort
Merge Sort guarantees O(n log n) time and can be stable, but standard array implementations require additional memory. Quick Sort is typically in-place and often has excellent cache behavior, but its worst case is O(n²) unless a robust strategy is used. The choice depends on stability, memory, worst-case guarantees, data layout, and implementation environment.
Choose Merge Sort when stable sorting or predictable O(n log n) time is important.
Choose Quick Sort when in-place behavior and practical performance are priorities.
External sorting commonly uses merge-based techniques.
Production implementations may use hybrid or introspective algorithms.