• Still quadratic, right? I'm looking for the worst case behavior, it's still quadratic, it's quadratic in the length of the list, so I'm sort of stuck with that.

    还是平方,对吧,寻找最坏的情况,它还是平方,它是列表长度的平方,对此有点无奈了。

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

  • How do I figure that out? Well I'm looping down the list, right? I'm walking down the list.

    怎么算出来的呢?循环遍,历这个列表对吧?那要遍历这个列表

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

  • And then, if I want to find out if something's there, I do the same thing. But notice now, hash is converting the input into an integer.

    然后,想查找出某些元素是否列表中,做同样的事,但是现注意,哈希是将输入转化成一个整数,所以,其思想是什么?

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

  • So let me expand on that very slightly, and again we did this last time but I want to do one more time. I have to be careful about how I'm actually implementing a list.

    们之前做过了一次,但还是再做一次吧,得小心的列表中执行,例如这个例子中。

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

  • The second question I want to ask is what's the base case? When do I get down to a problem that's small enough that it's basically trivial to solve? Here it was lists of size one. I could have stopped at lists of size two right. That's an easy comparison.

    第二个问题是什么是基础条件?,要将问题分解到何时才使得问题,小到可以解决的基本问题?,这里是当列表的长度为1有时候,也可以长度为2的时候停止分解,那是一个非常简单的对比。

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

  • I'm returning that as my set.

    所以创建一个列表

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

  • I'll let you just grok it but you can see it's basically doing what I did over there. Setting up two indices for the two sub-list,it's just walking down, finding the smallest element, putting it into a new list. When it gets to the end of one of the lists, it skips to the next part, and only one of these two pieces will get called because only one of them is going to have things leftovers.

    你们可以大体的浏览一下,但是它们基本就是那里所做的事情,为两个子列表设置了两个指针,指针顺着列表走下去,找到最小的元素,把它放入到一个新的列表中去,当它走到一个列表的尾部时,它会跳到下部分去,两部分中只有一个会被执行,因为只有一个会有元素剩余。

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

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

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

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