• Up on the screen, I've got-- I commented it out, but I've got a piece of code that you've seen before, right up here. OK?

    我现在在大屏幕上标出来的,是你们以前看过的一段代码,就在这儿?

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

  • All right so-- yeah, how do I get to the code for that? That's interesting.

    噢,我是怎么写出这个的代码,这件事儿挺有意思的。

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

  • - Writing code that just looks-- I'm not even sure what this is supposed to look like, a little flower or pinwheel or something like that.

    这代码写出来有点像-,我不确定这像什么,像朵花,或纸风车,或其他什么东西。

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

  • Again, I want you to start seeing how to map the characteristics of the code- the characteristics of the algorithm, let's not call it the code-- to the complexity.

    是算法中的那些特性,我们还是别说代码了,转化为复杂度-,我一会儿还会再讲点儿这个的,但是我们再看一个例子。

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

  • Right, and just to get a sense of this, let's look at a simple little example, so on your hand-out, you'll see I've got a little piece of code that says assuming I've got one of these points, I want to do things with it, for example I might want to add them together.

    这些数组中的一个,你怎么能够知道,它是哪种类型的呢?,你怎么知道它是以笛卡尔坐标,表示的还是以极坐标,形式表示的呢?,你没有可以用来区分的东西,你没有说明这种信息,聚集实际上的意义。

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

  • So let's look at the second example, all right, I keep doing that -- this piece of code from here to here gives me a way of now creating a hash table of size 256.

    所以让我们来看一下第二个例子,好的,我继续做那件事,这段代码中从这里到这里,是创建一个大小为256的哈希表。

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

  • And in particular, if I think about that problem - actually I want to do this- if I think about that problem, I'm going to write a little piece of pseudo code.

    关于这个问题尤其要注意的是,实际上当我考虑这个-,问题的时候我想这么做,我会去写一点伪代码。

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

  • OK? And in fact, if you look at the code up here, and it's on your handout, the very first one, x 1, right here- if I could ask you to look at it-- is a piece of code to do it. And I'm less interested in the code than how we're going to analyze it, but let's look at it for a second.

    实际上,如果你看看,你们课堂发的材料上面的代码,第一页上的,就是那-,大家请看看实现的这一部分代码,我不太关心,我们会怎么解释这个代码,首先让我们先看看。

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

  • to do sqrt, or square root-- no, I'm going to square root use sqrt, that's the name I'm using here-- square root a hundred different places in some piece of code. Without function, I'd have to copy that piece of code everywhere.

    让我做一下准备,想象一下我要调用sqrt或者-,不,我会调用sqrt函数,这是我在这里用的名字,我得把这段代码到处复制。

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

  • I can't rely on Professor Guttag if I give this- if this code to him, I can't rely on him to type in a float. Actually I can, because he's a smart guy, but in general, I can't rely on the user-- I wouldn't do it right to see if you did.

    当Guttag使用这段代码的时候-,我不能相信他一定会输入一个浮点数,实际上我能因为他很聪明,但是总体上来讲,别相信用户一定会按照规则来-,我会故意做错来试试你的程序的。

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

  • All right. If you flip to the second side of your handout, you'll see that I have a piece of code there, that does this-- let me, ah, I didn't want to do that, let me back up slightly- this is the algorithm called search.

    你可以看到实现这个功能的代码,让我,额,我不想这么做,让我们回来一点,这就是命名为search的算法-,我们来看看这个算法吧。

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

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

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

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