Dynamic Programming Learning Summary

Understanding of the dynamic programming

Similar dynamic programming algorithm to divide and conquer, the basic idea is to solve the problem will be broken down into several sub-questions, the first sub-problem solving, solution of the original problem and the solution obtained from these sub-issues. And divide and conquer different is suitable for solving the problem using dynamic programming, the decomposition sub-problems are often not independent of each other. Too many problems if the number of children with a divide and conquer method to solve this problem, the decomposition of some sub-problems were double-counted many times. If we can save the child the answer to the problem has been resolved, and in the need to find out the answers have been obtained, so you can avoid a lot of double counting, save time. We can use a table to record the answers to all sub-problems have solution. Whether being used in the future regardless of the sub-problems, as long as it is calculated that it will fill in the results table. This is the basic idea of ​​dynamic programming. Specific dynamic programming algorithm varied, but they have the same filling format.

There are two places not quite understand:

No after-effects of the characteristics of dynamic programming; different dynamic programming algorithm and greedy algorithm.

Programming problems recursive equation 2

第1题:lmisCurrent[i] = max(lmisCurrent[i], lmisCurrent[j]+1)(0<i<n, 0<j<i, a[i] > a[j]))

第2题:dp[i][z]+dp[z][j](i+1<=z<=j)

Pair programming situation

In addition to hands-on practice lessons no communication, because less cored.

Guess you like

Origin www.cnblogs.com/Texas/p/11790000.html