Now, when we talked about optimization problems in dynamic programming, I said there were two things to look for.
现在,当我们讨论,动态编程中的最优化问题时,我想说有两件事需要注意。
And when you have an optimal substructure and the local solutions overlap, that's when you can bring dynamic programming to bear.
当你得到一个最优子结构,但局部解决方案有重跌时,你就可以引入动态编程,来解决这个问题了。
So when you're trying to think about is this a problem that I can solve with dynamic programming, these are the two questions you ask.
所以当你想知道能否,用动态编程来解决这个问题时,你可以问自己两个问题。
And this is what lies at the heart of this very general technique called dynamic programming.
这也就是动态编程,这种通用技术的核心。
That's a huge improvement. And that's sort of the magic of dynamic programming.
这是一个很大的进步,这也是动态编程的魅力所在。
In dynamic programming, one of the things that's going on is we're trading time for space.
在动态编程法中我们是在用,空间换时间,除了动态编程法。
Dynamic programming is not the only time we do that.
我们在其他算法中也会用到这一点。
That would let us tackle it with dynamic programming.
回答好这个问题我们,就能用动态编程法解决这个问题。
That gets us to the smart thief. Why is this thief smart? Because she took 600. And she learned 600 that in fact there is a good way to solve this problem. And that's what we're going to talk about next. And that's something called dynamic programming.
现在我们要当聪明的贼,这个贼为什么聪明呢?,因为它选择了,它知道这事实上是解决这个问题的好方法,这就是我们接下来要讲的,也就是动态编程。
应用推荐