All right, so you wrote out these squares, you realized what your partner was going to do, and responded to that.
这么说你也写下了这些矩阵,你分析出了对手的选择并依此做出的选择
And the second thing that we talked about is this idea that we want you to in fact learn how to relate a choice you make about a piece of code to what the efficiency is going to be.
关于这个方法第二件事,就是我们实际上希望,你在写代码的时候,能做出优化效率的选择,因为此。
So if you have a boss you might want to and he or she is going to ask you why you chose the action you did.
所以如果你为别人打工,你的老板问你为什么做出这样的选择
What choices are you going to make.
你会做出怎样的选择呢。
Well, I guess in the first case where you have the one worker and the five, it's a choice between those two and you have to make a certain choice and people are going to die because of the trolley car, not necessarily because of your direct actions.
我认为,在第一种情况中是撞死一个还是五个,你只能在这两者中选择,不管你做出的是哪一个选择,总得有人被电车撞死,而他们的死,并非你的直接行为导致。
And I would suggest palindrome as a great example of that. That's easy to think about recursively. It's much harder to think about iteratively. And you want to get into the habit of deciding which is the right one for you to use. And with that, we'll see you next time.
其它的问题可能用递归的方式,可以更好的解决,而直接思考可能很困难,这时你就得养成做出,正确选择的好习惯了,下周再见。
应用推荐