Where those pieces, I would do the same thing with, I would divide them up into smaller chunks, and sort those. Is that going to give me a more efficient algorithm?
合并起来,而那些小列表,我又会把他们拆成更小的列表,再排序,这会给我,一个更高效的算法么?
and then they kind of match it up with some algorithm.
然后他们用某算法将信息匹配一下,
All right? I don't care what's in there, but just assume that's my list. And just to remind you, on your handout, and there it is on the screen, I'm going to bring it back up, there's the little binary search algorithm.
好,我不管列表里是什么,就假定那是一个列表,要提醒你们的是,在你们的讲义上和屏幕上,有一个简单的二分查找算法。
It couldn't have been a very complicated algorithm because it basically paired people up randomly on the campus.
这个算法不是很复杂,基本上是给校园里的人随机配对。
> So now that might not have felt like the fastest algorithm but think about what you could have done with that algorithm in each iteration, much like the phonebook up front here, you literally split that problem in two because on each iteration roughly half of you were sitting down and then another half and then another half.
虽然这并不是最快的算法,但如果把这种算法每次迭代,就像刚才查电话簿一样,你便将这个问题一分为二了,因为每一次迭代后只有一半坐下来,以此类推。
And probably the obvious thing you'll think about is, we'll come up with a clever algorithm. And I want to disabuse you of that notion.
可能你想到的最有效的方法,就是设计一个,聪明点的算法了,这正是我想你们注意到的。
At the University of Minnesota, a computer algorithm paired people up.
在密尼苏达州立大学,通过计算机算法将同学分组。
All right. If you flip to the second side of your handout, you'll see that I have a piece of code there, that does this-- let me, ah, I didn't want to do that, let me back up slightly- this is the algorithm called search.
你可以看到实现这个功能的代码,让我,额,我不想这么做,让我们回来一点,这就是命名为search的算法-,我们来看看这个算法吧。
But in general, it's hard to come up with the really clever algorithm.
但是通常来讲,真正巧妙的算法,确实非常难设计。
应用推荐