I can't understand DP table Method especially with it's memory saving tricks.
Need help with references or anything explains it well.
DP Table Method
Moderator: Board moderators
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: DP Table Method
Check input and AC output for thousands of problems on uDebug!
-
- New poster
- Posts: 11
- Joined: Fri Nov 08, 2013 11:04 pm
Re: DP Table Method
i had the same problem, but if you see when we close the recurrence formula, we know where to get the things on the table by the parameters of the function on the formula, example:
http://www.geeksforgeeks.org/dynamic-pr ... -distance/
on this formula we need to take the states that are stored on M[ i-1 ][ j ] , M[ i ][ j-1 ] , M[ i-1 ][ j-1 ].
See the knapsack example that you're gonna take it.
http://www.geeksforgeeks.org/dynamic-pr ... -distance/
on this formula we need to take the states that are stored on M[ i-1 ][ j ] , M[ i ][ j-1 ] , M[ i-1 ][ j-1 ].
See the knapsack example that you're gonna take it.