The previous lesson worked SRBOT on a one-dimensional subproblem family (rod cutting, indexed by a single length). This note applies the same recipe to three canonical two-dimensional DPs — longest common subsequence (LCS), matrix-chain multiplication, and optimal binary search trees — each indexed by a pair of indices (a substring or subarray range), which is the signature shape of DP problems over sequences or orderings. The optimal-BST problem closes a direct loop back to Topic 3's balanced-tree machinery, this time optimising expected search cost rather than worst-case height.
In this lesson
- Learning objectives
- Longest common subsequence
- Matrix-chain multiplication
- Optimal binary search trees
Before you start
The full lesson, with worked examples and exercise solutions, is for members.
Read the full lessonNew to SelfMadeQuant.com? See membership options or explore the curriculum.