Linear algorithms tend to be things where, at one pass-through, you reduce the problem by a constant amount by one. If you reduce it by two, 1 it's going to be the same thing.
有问题么?,线性复杂度的算法,当进行了一个,常量级步数的操作的时候,将问题的规模缩小了一个。
All right, I've got to do one pass to bubble the last element to the end. I've got to do another pass to bubble the second last element to the end.
好的,我要冒一次泡来,把最大的元素冒到最后去,我还得再冒一次泡来吧第二大的元素。
In fact one of the frankly best things I ever did as an undergraduate was, perhaps fittingly, take this course pass-fail.
实际上我上本科时做的最得意的事,恰当地说,就是把这门课的成绩看成及格和不及格两种。
Conversely, if he goes on the hard pass and you defend the easy pass, he's going to lose one of those battalions.
相反,如果他选择崎岖之途,而你却防守平坦之路,那么他仅仅损失一个营的兵力
This is actually something very near and dear to my heart because I literally would not be doing what I do in life today had I not taken a couple of courses here, this one in particular, pass fail.
事实上,我是很关心的,因为今天我就不会站在这里,如果当初我没有这里上课的话,这门课,要么过要么挂科。
And that in my mind is one of the upsides of taking a course like this, pass fail, in order to take the edge off.
在我心中,考查课是对这门课程的一大提升,这个课程是按照。
But that's the only one he's going to lose because you were defending the wrong pass.
但是他只会损失一个营,因为你选择了在错误的途径设防
And the other one is an easy pass. It goes along the coast.
另一条路平坦,只需沿着海岸线走
One of these passes is a hard pass. It goes over the Alps.
一条路崎岖,需要翻越阿尔卑斯山
If the invader chooses the hard pass he will lose one battalion of his army simply in getting over the mountains, simply in going through the hard pass.
如果侵略者选择崎岖的路,仅在穿越阿尔卑斯山的途中,他就要损失一个营的兵力,这就是选崎岖之路的代价
So if you defend the easy pass, from his point of view, it doesn't matter whether he chooses the easy pass and gets one in there or the hard pass, he gets one in there.
那么如果你防守平坦的路,从他的立场出发,无论怎么选择,选崎岖之途收益是1,而选择平坦之途的收益也是1
If you were to defend the easy pass and he goes through the easy pass, he will get into your country with one battalion and that's the same as he would have got if he went through the hard pass.
如果你们都选择的是平坦之途,那么他攻入你的国家时他只剩一个营,这与他选择崎岖之途别无二致
So just to give an example, if he goes through the hard pass and you defend the hard pass, he loses one of those battalions going over the mountains and the other one because he meets you.
举个例子吧,如果入侵者与你在崎岖之途上狭路相逢,他在翻越山岭时损失一营,与你交战再损失一营
应用推荐