Merge sort · feature exploration

Step into the merge

On the merge-sort ladder, “pass 1” only shows the result of merging the singletons from “start”. These three options let you zoom in — like a debugger's step into — to watch the comparisons that produced each pass. Same underlying mechanic, three different chrome.

Option A · inline “step into” drawerexpand in place

▸ Each pass shows the result. Click a pass to expand a drawer that replays the merges that produced it — like opening a stack frame.

start
width 1
5
2
8
1
9
3
7
4
pass 1
width 2
25
18
39
47
stepping into pass 1 · merge 1 of 4
merge #1 ← here
RUN A
5i
RUN B
2j
compare 5 > 2 → take 2
OUT
empty
merge #2 · queued
RUN A
8i
RUN B
1j
OUT
empty
merge #3 · queued
RUN A
9i
RUN B
3j
OUT
empty
merge #4 · queued
RUN A
7i
RUN B
4j
OUT
empty
comparison 1 / 8
pass 2
width 4
1258
3479
pass 3
width 8
12345789