Merge Sort

Back to Comparison-Based

A divide-and-conquer algorithm that splits the array in half, recursively sorts each half, and merges the sorted halves. Guarantees O(n log n) time in all cases. Stable but requires O(n) extra space.

algorithms sorting merge-sort