• When I call or invoke a function, think of it as creating a local table.

    当我调用一个函数时,想象一下它是这里创建了一个局部表。

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

  • Notice the form of it, it's just the name of the class followed by open paren, close paren, treating it like a function.

    我该怎么来使用类呢?,好,我可以像调用方法,一样调用类,你可以下面看到,创建一个名为。

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

  • Well, if that function calls another function, you put another tray on, and so that new tray represents that function's chunk of memory.

    好的,如果那个函数调用另一个函数,你再放一个托盘上面,新的托盘代表,那个函数的内存块。

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

  • Python So I'm using the Python try except to check whether or not the thing is in the memo or not.

    所以我将让,去调用except去判断该物品,是否已经memo中。

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

  • Right now it's empty, actually it's not quite empty, it has a pointer back to the class.

    当我调用了这个类的,定义声明的时候,它内存中的特定点。

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

  • Every time I use it, I'm creating a new instance, that's a different thing inside of memory.

    我每次调用它,我就新建了一个类,这内存中是个不同的事情。

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

  • Let's go the other direction. And yes, I guess I'd better say s not 2, or we're going to get an error here. Again, in twenty-three checks.

    这里我得说不能是2,否则要报错了,再一次,调用了23次,这个例子里,它从尾部开始。

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

  • When I ran it up here, with the old Fib, and we printed the result, and I ran it with Fib 1 down here.

    当我运行到这里,也就是老的Fib函数,我们打印这个结果,当我下面调用Fib1时,也打印了结果。

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

  • We're going to call binary search, it's going to take the list to search and the element, but it's also going to say, here's the first part of the list, and there's the last part of the list, Well, it checks to see, is it bigger than two?

    我们将要调用这个二分查找,它将会列表里面搜索元素,假定这里是,列表的第一个元素,那里是列表的最后一个元素,代码内部到底做了什么?

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

  • I just doubled the indentation each time so you can see it. So each successive call, notice what's happening. The argument is getting reduced. And we're going another level in. When we get down to this point, we're calling it with just a string of length one.

    因此每次成功调用注意它的过程,我们的命题不断简化,而且我们不断深入嵌套,当我们走到这一步的时候,我们就是在调用它处理,仅有一个元素的字符串了。

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

  • So, in this program when we call this version of swap 1 and 2 do not end up here, right?

    所以,这个程序中,当我们调用这个swap版本1,和版本2,不是这里结束,对不?

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

  • Now if you call a function, swap like increment or cube or swap, or in this case, foo, those variables are the parameters to that function, end up getting stored next in memory.

    如果你调用一个函数,像increment或者cube或者,或者这个例子里,foo,这些变量都是,函数的参数,内存中存储。

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

  • Notice in the class definition here, is there, this is the first thing that's got called, and I just called with the value for x and the value for y, and it went off and did something for me.

    这里,这是第一个被调用的东西,我用x的值和y的值调用了它,然后这个方法继续进行,并为了做了一些操作。

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

  • 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函数,这是我这里用的名字,我得把这段代码到处复制。

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

  • malloc sizeof So, when I call malloc size of int and int on this system is probably 4 bytes or 32 bits so what am I getting back?

    所以,当我调用,这个系统中int可能是4个字节,或者说32位,那么返回的是什么呢?

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

  • It could be normal, everything, that would be a Gaussian, where if you recall there was a mean, and a standard deviation, and most values were going to be close to the mean.

    可能是正态分布,也就是高斯分布,只要有平均值和标准偏差值,你就可以进行调用,大部分的值都是集中平均值附近的。

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

  • I've used solve. All right? Right there.

    调用了solve对吧?就这儿。

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

  • And when you call a function, one of the things X that happens is whatever your passing in, for instance, X, ; and if this is A, this thing gets copied into A; so at that moment in time of calling increment, I actually have two copies of the same value in memory but they're referred to by different names.

    当你调用一个函数,其中发生的一件事情是,不管你输入什么,比如,或者是A,它把这个东西复制到A中;,调用increment的时候,实际上内存中,有两个同样的值的内存块,但是它们有不同的名字。

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

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

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

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