Dynamic Programming21 sections · 916 units
Open in Course

Prefix Min Operation - Walkthrough

How prefix min affects the function

Computing minyxf(y)\min_{y \leq x} f(y) transforms the function. The result is a non-increasing prefix of the original. Graphically: walk from left to right, keep the minimum seen so far.

The function flattens into a non-increasing staircase. On the heap: prefix min removes all right breakpoints. The function becomes flat from its minimum onwards. This is why right heap matters: prefix min empties it. The slope to the right of minimum becomes 00.