• We started off talking about binary search, and I suggested that this was a log algorithm which it is, which is really kind of nice.

    我告诉了你们这是一个对,数级的算法,这是很棒的,我们来一起看看这个算法到底做了什么。

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

  • OK. So this is, in fact, log. Now, having said that I actually snuck something by you.

    就是对数次,我已经教给你们一些。

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

  • It'll say is this really what you ate, and if you ate it, then you say yes I ate this, and then it adds to the electronic log.

    系统会问这是否确实是你吃的,如果确实是 就选择是,你的选择会被记入电子日志

    耶鲁公开课 - 关于食物的心理学、生物学和政治学课程节选

  • A number of men, as one historian has written, I think quite effectively, "Mounted from log cabin to mansion" and I quote "On a stairway of cotton bales accumulating slaves as they went."

    一些人就像一位历史学家写的那样,我觉得非常犀利,引述一段,"小木屋通往大厦的阶梯正是由,奴隶们用棉花包堆积成的"

    耶鲁公开课 - 美国内战与重建课程节选

  • 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等于。

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

  • Right? If that was the case in that code, then my complexity is no longer log, because I need linear access for each time I've got to go to the list, and it's going to Lisp be much worse than that.

    这里的复杂度不再是对数的了,因为每次在列表中,查找需要线性访问,可能还要糟糕,其实,有些编程语言,如。

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

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

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

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

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

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

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

  • 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开始,然后是。

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

  • If I'm running at nanosecond speed, 1000 n, the size of the problem, whatever it is, is 1000, and I've got a log algorithm, it takes 10 nanoseconds to complete.

    如果这个问题的规模,也就是n,是,如果这个问题是对数级的,这将会占据10纳秒的时间,你一眨眼的时间。

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

  • 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,次。

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

  • 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级的行为。

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

  • With this, if I can assume that accessing the i'th element of a list is constant, then you can't see that the rest of that analysis looks just like the log analysis I did before, and each step, no matter which branch I'm taking, I'm cutting the problem down in half.

    读取数组中的第i个元素,是个常量时间的操作的话,我也就能像以前那样得到,这个算法是对数级复杂度的分析,并且每一步不管我选择哪个区间,我都可以把问题的规模缩小一半。

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

  • 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的线性搜索,或者也可以以这个列表为例,我们先将其进行排序,然后再进行查找,但是在这种情况下,要花费n,log,n的时间去对其进行排序。

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

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

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

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

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

    一旦对其完成排序,就可以在log,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
- 来自原声例句
小调查
请问您想要如何调整此模块?

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

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