Dynamic Programming21 sections · 916 units
Open in Course

The Split Point Approach

Dividing ranges

Most interval DP problems ask: what's the best way to process a range? The answer depends on where you split it. For range [i,j][i,j], you try every split point kk from i to j-1. Splitting at k means you process [i,k][i,k] and [k+1,j][k+1,j] separately, then combine. You pick the k that gives the best result. This creates O(n)O(n) choices per state, and O(n2)O(n^2) states, giving O(n3)O(n^3) time overall. Time complexity: O(n3)O(n^3).

Space complexity: O(n2)O(n^2) for the dp table.

Space: O(n2)O(n^2) for the DP table. That's the signature complexity of interval DP.