Skip to content
DSA Visualizerpreview

Merge sort

Split in halves, sort each half, then merge the sorted halves.

O(n log n) time · O(n) space

Values38, 27, 43, 3, 9, 82, 10

Start with the array 38, 27, 43, 3, 9, 82, 10.

View
1 ranges across 4 layers of recursion; the deepest layer in use is 0.
  • compare
  • swap or write
  • settled

1 / 34

Speed

Space play · ← → step · Home End jump · drag the strip to scrub