sorted-check lab · mode 1 of 2 · run editor

One if before the merge.
Move the runs and watch it pay.

Plain top-down mergesort, plus a single test: after sorting both halves, merge only when A[m-1] > A[m]. A call whose whole range sits inside one run fails that test and pays nothing. This is not the run-adaptive framework — there is no run decomposition and no merge tree over runs, just the fixed dyadic recursion with some of its merges switched off. Drag the run strip at the bottom of the tree; everything above it is rebuilt on every change.

recursion tree · faded = merge skipped

merge cost  

drag a boundary to resize two runs · drag a run past its neighbour to swap · click to select · select   resize (shift ×10)  s split  j join  d duplicate  x delete  ,. swap  u undo  space play  f present