• And so the fact that in this whole slide here, this algorithm for sorting, I'm using the verb sort.

    在这个排序算法中,我用到了一个动词排序

    哈佛公开课 - 计算机科学课程节选

  • 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?

    合并起来,而那些小列表,我又会把他们拆成更小的列表,再排序,这会给我,一个更高效的算法么?

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • 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?

    这就说明此算法会一次又一次地调用自己,每次我要排序的问题规模大小,会除以多少呢?

    哈佛公开课 - 计算机科学课程节选

  • So this is a nice little search-- sorry, a nice little sort algorithm . And in fact, it's relying on something that we're going to come back to, called the loop invariant.

    恩,这是一个很棒的小搜索,抱歉,和很棒的小排序算法,事实上,它依赖于一些我们要回顾的东西,被称作循环不变量。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Just contrast this for a brief moment to something like Selection Sort which from the get go had a ridiculous amount of redundancy comparing the same damn numbers again and again, and again.

    这就与其他的排序算法形成了鲜明的对比,比如选择排序,它会一次又一次地做,多余的比较。

    哈佛公开课 - 计算机科学课程节选

  • And we haven't seen all of these sorts, but it's actually quite neat to recognize how different the underlying work is of each of these algorithms.

    我们还没有探讨所有的排序算法,但应该很容易区分,每一种算法其内在的,不同之处。

    哈佛公开课 - 计算机科学课程节选

  • 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, we saw the teaser in terms of that animation that suggests this merge sort algorithm when implemented by a computer is absolutely faster.

    我们从前面的动画中可以看到,这个归并排序算法在计算机上实现之后,绝对比其他算法更快。

    哈佛公开课 - 计算机科学课程节选

  • OK. Today, for the rest of the lecture, we're going to take a break from the topic of algorithms, and computation, and things of the sort. And do something pretty pragmatic.

    好,今天剩下的时间里,我们不再讲算法,计算和排序这些话题了,我们会做一些非常实用的事,我们主要的讲讲测试。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Blah, try again. How to do this sort.

    首先我想说的是被称作选择排序算法

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Alright, I have the problem so clearly this algorithm whatever it's gonna be is gonna be at least twice as fast because I'm doing half as much work.

    现在,这个问题已变得清晰,不管怎么样,排序算法的效率,至少是之前的两倍,因为我只需要做一半的工作。

    哈佛公开课 - 计算机科学课程节选

  • Selection sort too really reduces to a total number of comparisons because I'm again comparing the current smallest to the next thing I see, the next thing, so really a lot of these sorting algorithms boil down to comparisons and the numbers that you actually have to make.

    选择排序也可归纳为总数的比较,因为要将当前最小者与下一个进行比较,接着再下一个,可见,很多排序算法都可归结为比较,以及需要比较的次数。

    哈佛公开课 - 计算机科学课程节选

  • Well, you need an algorithm for sorting.

    你需要一种排序算法

    哈佛公开课 - 计算机科学课程节选

  • So the first one here is something called insertion sort which amounts to going through the list, taking the first thing that you see and inserting that element into its correct place, - then moving on to the next one, dealing with what element-- whatever element you're given and putting it in its right place.

    首先是插入排序,在此算法中,需要遍历整个列表,将你遇到的第一个元素放在其正确的位置,然后移动到下一个元素,继续处理-,不管是什么元素,都将其插入到合适的位置。

    哈佛公开课 - 计算机科学课程节选

  • If we can sort things, you know, we get this n log n behavior, and we got a n log n behavior overall. But can we actually do better in terms of searching.

    如果我们可以排序,如你所知,我们有n,log,n级别的算法,并且我有一个整体的n,log,n级别的算法,但是我们在搜索方面可以做的更好吗?

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • So I propose this as a new algorithm for sorting N elements and being 8 in this case or really a thousand in the case of the phonebook, or anything of larger size.

    所以我提出一种新的算法,来解决N个元素的排序问题,在这个问题中N是8,在电话簿的问题中N是一千,或者是大规模的任何问题。

    哈佛公开课 - 计算机科学课程节选

  • If I'm using algorithm that I'm now calling merge sort, T the running time involved in sorting N elements, T of N, you know, is just the same as running the algorithm for the right half, plus what's this plus N come from?

    如果我用归并排序算法,对N个元素其运行时间,就等于此算法一半元素的运行时间,另一半的运行时间,再加上N,这个N是什么呢?

    哈佛公开课 - 计算机科学课程节选

  • And that's just a way of reminding you that we want to think carefully, but what are the things we're trying to measure when we talk about complexity here? It's both the size of the thing and how often are we going to use it? And there are some trade offs, but I still haven't said how I'm going to get an n log n sorting algorithm, and that's what I want to do today.

    这只是在提醒你们我们要仔细的思考问题,但是当我们在讨论复杂性的时候,我们到底要衡量哪些东西?,是列表的大小和对其进行查找的频率吗?,这里面临一些取舍,但是我还没有说明,怎样得到一个n,log,n复杂度的排序算法,并且这是我今天想要讲的内容。

    麻省理工公开课 - 计算机科学及编程导论课程节选

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定