Algorithm visualizer
Pick an algorithm, enter your own numbers or use a preset, then step through the run. The pseudocode and the explanation follow each step.
Split the array in half, sort each half, then merge two sorted halves by repeatedly taking the smaller front value.
Pick an array of 5 values. How many levels of splitting happen before every half has one value?
Step 1 of 40
Split a[0..7] at mid = 3. Sort each half first.