Sorting visualizer
Merge Sort
Divide the array, then merge sorted halves.
Example Array
[42, 17, 8, 33, 25, 11, 60, 29]Visualization
ComparingMoving / writingPivotSorted
Metrics
Comparisons0
Writes0
Progress0%
Time taken0.0s
mergeSort(arr, left, right)middle = (left + right) / 2mergeSort(left half)mergeSort(right half)compare values from both halvescopy remaining left valuescopy remaining right valuesmerge both halvesreturn arr
About Merge Sort
Merge Sort recursively divides the array into smaller halves and combines them in sorted order. Its predictable time complexity makes it effective for large datasets.
Sorted Output
[ 8, 11, 17, 25, 29, 33, 42, 60 ]Complete the visualization to reach this output.
Complexity Overview
Best CaseO(n log n)
Average CaseO(n log n)
Worst CaseO(n log n)
SpaceO(n)
StableYes