Interactive merge sort. Watch the array split until each piece is one element, then merge sorted pairs back together.

Split tree · merge phase piece comparing picked merged
Step 0 / 0

Press Play. First split the array, then merge pairs by taking the smaller front each step.

Speed
comparisons
0
merges done
0
depth
0
progress
0%
mergeSort(arr):
if length ≤ 1 → return
split into left, right
mergeSort(left)
mergeSort(right)
merge(left, right):
take smaller front each step
timeline0 / 0
space  walk steps