• It at least does corroborate the claim that merge sort N*log N as we argue intuitively is in fact, N log N in running time.

    但这至少证实了归并排序,的时间复杂度为。

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

  • Boy, there's a dumb question, because I've been telling you n log n for the last two lectures the complexity is n log n, but let's see if it really is.

    孩子们,这是一个愚蠢的问题,因为前两节课的时候我就已经告诉你们了,复杂度是,但是让我们来看一下是不是真的是这样。

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

  • But mathematically, we've mentioned this before, log N or really to be precise, log base 2 of N, is the way you express this mathematically.

    但从数学上说,之前我们已经提到过了,准确地说是logN,以2为底N的对数,这就是它在数学上的表示。

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

  • And we said that was log rhythmic, took log n time where n is the size of the list.

    当列表的长度为n的时候,整个算法耗时logn的时间。

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

  • N log N is not nearly as good as log N. As a sanity check, what algorithm have we seen that runs in log N time?

    NlogNlogN并不一样,我们之前探讨过的哪个算法其时间复杂度是logN呢?

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

  • So I have n operations log n times, n log n there we go, n log n. Took us a long time to get there, but it's a nice algorithm to have.

    所以我logn遍的n次操作,就得到了,虽然花了不少时间得到了这个结论。

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

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

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

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

  • Log n Log n, because at each stage I'm cutting the problem in half. So I start off with n then it's n n/2 n/4 n/8 over two n over four n over eight.

    因为总共有多少层?,因为在每一层,我都是把问题分解成两半,因此以n开始,然后是。

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

  • k * n m plus k all times log n is in general going to be much better than k times n.

    在普遍情况下要远远好于,实际情况要取决于n和k的取值。

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

  • But that merging process only takes N steps, N*log N so that's N times log of N. Now, it's a little tricky to reason through this perhaps the first time, let's just take a very simple example and see if we can do a little sanity check here.

    但这个合并过程只需要N步,所以时间复杂度是,第一次对此进行推论可能会有点儿棘手,我们举一个简单的例子,看看我们能否做一些完整性的检查。

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

  • And if you ask the TAs in recitation tomorrow, they'll tell you that you see a lot of n log n algorithms in computer science.

    如果你明天在复习课上问助教的话,他们会告诉你在计算机科学中,存在着非常多的nlogn规模的算法。

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

  • 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步操作,一共要做,logN,次。

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

  • And what does N log N feel like vis-a-vis N squared?

    N平方相比,N*logN又是怎样的呢?

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

  • I could still do the linear case, which is order n or I could say, look, take the list, let's sort it and then search it. But in that case we said well to sort it was going to take n log n time, assuming I can do that.

    我仍然可以做O的线性搜索,或者也可以以这个列表为例,我们先将其进行排序,然后再进行查找,但是在这种情况下,要花费nlogn的时间去对其进行排序。

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

  • On the other hand, if I want to sort it first, OK, if I want to do sort and search, I want to sort it, it's going to take n log n time to sort it, and having done that, then I can search it in log n time.

    我先排序,好的,如果我想排序再搜索,我要排序,这需要花nlogn时间排序,然后做完了,我们能花logn时间搜索,啊,哪一种更好呢?恩,呵呵。

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

  • Perhaps more importantly, how to recognize a kind of algorithm based on its properties and know what class it belongs to. This is a hint. If you like, leaning towards the next quiz, that you oughta be able to say that looks like a logarithmic algorithm because it's got a particular property. That looks like an n log n algorithm because it has a particular property.

    也许更重要的是,如何根据一个算法的特点将其辨别出来,并且知道它属于哪一类算法,这是一个提示,就对于接下来的测验来说,如果你喜欢你可以说它看起来像一个对数算法,因为它有一个特定的性质,那个看起来像一个nlogn的算法,因为它有一个特定的性质。

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

  • Once I have it sorted I can search it in log n time, but that's still isn't as good as just doing n. And this led to this idea of amortization, which is I need to not only factor in the cost, but how am I going to use it?

    一旦对其完成排序,就可以在logn的时间内对其完成搜索,但是这样做仍然不如n的复杂度,这样做引出了耗时分摊的想法,这时不仅需要考虑耗时的因素?

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

  • And then one of the things that I suggested was that if we could figure out some way to order it, and in particular, if we could order it in n log n time, and we still haven't done that, but if we could do that, then we said the complexity changed a little bit.

    这就涉及到了排序,如果可以想出一种来将其进行排序,甚至可以在nlogn的时间内完成,虽然目前我们没做这件事,但是一旦开始做这件事,那么复杂性就是发生一些变化。

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

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

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

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

  • N 6 Sixteen, so that's 16 times log base 2 of 16 and though I'm writing small here, log base 2 of 16, 16 this gives me 4 'cause 2 to the 4 equals 16.

    是多少呢?,Well,,N,is,what?,16,那就是16乘以以2为底16的对数6,在这儿我将2写小一些,以2为底16的对数是4,因为2^4等于。

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

  • It would be nice if it was less than linear, but linear is nice because then I'm going to get that n log in kind of behavior.

    那么就是一个不错的算法,但是线性方案也是很好的,因为我需要做n次的log级的行为。

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

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

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

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