They are computationally challenged, meaning, at the time they were invented, they were perfectly good sorting algorithms, there are better ones, we're going to see a much better one next time around, but this is a good way to just start thinking about how to do the algorithm, or how to do the sort.
他们是相当棒的排序算法,是有更好的算法,我们下一次,就会看一个更好的,但是开始想想,如何完成算法,或者说是如何排序,是一个好的学习方法,恩,再试试吧,如何来排序呢?
- Well-- -- I'm-- maybe-- I'm sorry, maybe-- -- No, no, no, no. I-- I think-- -- That's not a-- I-- I think the Bubble Sort would be the wrong way to go.
笑声】,嗯-,我,很抱歉,可能是-,不,不……,我觉得-,那不是-,我觉得冒泡排序应该不是正确的方法。
OK. That's one way to do this sort.
好的,这是做这种排序的一种方法。
And so you have to go back to the drawing board and realize Bubble Sort or whatever it is you're using just isn't enough to snuff, I need to come up with something more clever.
因此,你必须重新开始,而且会意识到冒泡排序,或你正在使用的方法并不理想,我需要提出一种更好的方法。
So to just preface what we're going to do next time, what would happen if I wanted to do sort, and rather than in sorting the entire list at once, I broke it into pieces, and sorted the pieces, and then just figured out a very efficient way to bring those two pieces and merge them back together again?
所以为了引导下一次,我们要讲的内容,如果我想做排序,而且不是一次吧整个列表排完,会发生什么,我把它拆成小的列表,然后把各个小列表排序,接着用高效的方法再把小的列表?
Like what the heck have we been spending our time for-- our time on with Bubble Sort and with Selection Sort and in fact there's plenty of other N squared sorts that we're not even gonna bother looking at.
真见鬼,我们竟然在-,冒泡排序和选择排序上花时间,而事实上,还有很多我们根本都不想考虑的,复杂度为N平方的排序方法。
I can tell you how to sort N elements by saying in kind of a snide way.
我可以告诉你一种方法,去对这N个元素进行排序。
应用推荐