I finally figured out what's going on with dynamic programming--and it's really not that hard once I wrapped my mind around it. I think I expected it to be really confusing: one of the first sentences in the chapter was "many people have a difficult time understanding it."
It turned out that I've actually used the technique before, I just didn't know what it was called. Anyway, the basic idea is to break up the problem into a bunch of subproblems, each of which needs to be solved more than once. Then, you can store the solutions to the subproblems so you only have to solve each one once.
No comments:
Post a Comment