Algomination
Sorting
Searching
Data Structures
About
Contact
All sorting algorithms
Merge Sort
Time O(n log n)
Space O(n)
Recursively splits the array, then merges sorted halves back together. Stable, O(n log n).
Visualize
Random
8
3
5
1
9
2
7
4
Starting Merge Sort.
Play
Step 1 / 47
0.5×
1×
2×
4×
Sub-array
Swapping
Sorted