It implies that this algorithm is calling itself again and again, and again, and on each time the size of the problem I'm trying to sort is being divided by what?
这就说明此算法会一次又一次地调用自己,每次我要排序的问题规模大小,会除以多少呢?
I'm thinking about a problem, I'm going to show you an example in a second, first thing I'm going to do is say, what is the thing that's going to change every time I run through the same set of code?
我要解决一个问题,我马上会让大家看一个例子,第一件我要做的事情就是,弄明白每次运行同样的指令集时,每次都会改变的东西是什么?
I find that every time we do our meditation on Thursday, I'm always running to make it, or something happened before I get there, I'm like "Oh my God, meditation!"
我发现每次我们周四,要冥想时,我总是匆匆赶过去,或者是到达之前发生一点事故,我就好像“天哪,要冥想!“
I give it such a hard time each time I teach this class, that I'm often tempted to just drop it from the discussion altogether.
每次授课时我都对此严加斥责,而且经常想要直接放弃讨论。
The reason I don't want to play a strictly dominated strategy is, if instead, I play the strategy that dominates it, I do better in every case.
我不选择严格劣势策略的原因是,要我选了优势策略,我在每次博弈都得到更好的收益
And in this case, we go from 8 to 4 to 2 to 1 three times and then on each iteration of this algorithm, each pass across the board I'm touching N numbers, so that means I'm doing N things, log N times.
在这个例子中,我们从8得到4,到2,再到1,是3次,在这个算法的每次迭代中,每一趟我都会操作N个数,也就是所我每次要做N步操作,一共要做,log,N,次。
And I'll remind you, what I'm printing out there is first and last, with the range I'm looking over, and then just how many times the iteration called.
我要打印出来的是,每次的区间,也就是first和last指向的值,以及重复多少次了。
Because I keep counting down each time around-- mostly I've got to unload this candy which is driving me nuts, so-- thank you.
因为我每次循环b减了,我一共要执行这个循环b次,所以这里我们一共执行了3b次基本操作。
I'm going to give a name to that. And what you see there is I'm going to call divisors initially an empty tuple, something has nothing in it. Right here. And then I'm going to run through the same loop as before, going through this set of things, doing the check.
你们可以看到这里,我初始化一个空的元组,名为divisiors,这里,然后我会去运行,跟以前一样的循环,遍历这个集合内的东西,然后做检查,现在我要做的是,每次我找到了一个除数我要把它收集起来。
应用推荐