πŸ”€ Merge Sort: Complete Visualization

See the full picture: divide, conquer, and merge step by step

Phase: Initialization
Click "Next Step" to begin. Watch how Merge Sort recursively divides the array, then merges sorted pieces back together.
πŸ”§ Merge Operation in Progress
Left Array
Right Array
Result (Merged)
πŸ“ Algorithm
MergeSort(A, p, r):
if p < r:
q = (p + r) / 2
MergeSort(A, p, q)
MergeSort(A, q+1, r)
Merge(A, p, q, r)
Merge(L, R) β†’ Result:
// Compare heads
// Pick smaller
// Add to result
🎨 Legend
Unsorted
Currently Processing
Merging
Sorted
⚑ Controls
Time Complexity
O(n log n)