Fill by length
transcript
A range reads two shorter ranges. So they must be filled first. Which order does that?
The range 0 to 4 reads 0 to 2. It also reads 3 to 4. Both are shorter than 0 to 4.
Fill length one, then two, then three. Each range finds its parts ready. Row by row reads rows not filled yet. Those cells are still zero.
Run it with row order. It returns 23, not 53. Unfilled cells hold zero. Every merge then looks as if its right part were free. So the cost comes out far too low.
The outer loop is the length. The inner loop is the start i. Then j follows from i and the length.
Length one is ready first. Length two reads only length one. Length three reads lengths one and two. No range ever reads an empty cell.
The order is part of the algorithm. Fill short ranges first. Full breakdown in the lecture.