我正在寻找一个易于理解的例子,有人谁想要学习动态编程。这里有一些关于什么是动态编程的好答案.斐波那契数列就是一个很好的例子,但是它太小了,不足以划破表面。虽然我还没有上过算法课,但它看起来是一个值得学习的好主题,希望它在我春天的清单上。
Calculating Levenshtein distances was one of the first problems I solved with dynamic programming; I think it is a decent next step from the Fibonacci sequence in terms of complexity.
http://en.wikipedia.org/wiki/Levenshtein_distance
Check out this site: Dynamic Programming Practice Problems
The idea behind dynamic programming is that you're caching (memoizing) solutions to subproblems, though I think there's more to it than that.
There are many Google Code Jam problems such that solutions require dynamic programming to be efficient. Examples:
Welcome to Code Jam (moderate)
Cheating a Boolean Tree (moderate)
PermRLE (hard)
Note that each of the Code Jam practice contests has a "Contest Analysis" section for if you're stumped trying to solve the problem.
Here is a good tutorial comprising 29 solved DP problem with great explanation.