感覺動態規劃中最難的部分是在尋找 從狀態j到狀態i的遞歸式,就像證明歸納法一樣,你得找出具體的式子來。
top bottom
bottom up
1. Longest Increasing Subsequence:
L[i] = max(1+L(j))(j<l && a[j]<a[i])
//if not exist any a[j]<a[i]
L[i] = 1;
getmaxvalueof array a[]
2. Maximum Sum Increasing Subsequence
almost same with above
3. Maximum continous sum
4. rod cutting