Concept Flow - Matrix Chain Multiplication
Start with matrix dimensions array p
Initialize DP table m with zeros
Set chain length l = 2 to n
For each chain length l
For each i from 1 to n-l+1
Set j = i + l - 1
Set m[i
Repeat until full table filled
Result is m[1
We fill a table step-by-step to find the cheapest way to multiply a chain of matrices by trying all split points.
