DYNAMIC PROGRAMMING COMPILATION
Basic Recurrence Relation (Fibonacci type)
- Domino and Tromino tiling
- 552. Student Attendance Record II
- Dice Combinations (CSES)
- 1269. Number of Ways to Stay in the Same Place After Some Steps
a[i+1] constrained on a[i] (=> f[n][d], a[i] taking values 0 to d-1)
DP on INTERVALS
Standard questions ->
- Matrix Chain multiplication
- RNA Secondary structure using base pair maximization
DP on strings -> LCS Type
Choice of selection from an array (Knapsack type)
dp[j] = max(wj + dp[i], dp[j-1]) -> OBSERVE THAT FOR ALL IS NOT WRITTEN HERE, SO O(N)
Multiple choice of selection (Segmented least square type)
dp[j] = min(dp[j], Cij + dp[i]) for all 1 <= i <= j
Comments
Post a Comment