• Right? I've allocated a variable, it happens to be a pointer; it's still a variable, who know what's in it, right?

    ?我分配了一个变量,它碰巧是一个指针,它还是一个变量,谁知道它里面是什么?

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

  • You don't have to mention any of the local variables, because at this point in the story, they're just not relevant.

    需要提及任何一个局部变量,因为在这个地方,它们是相关的。

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

  • So this is a nice little search-- sorry, a nice little sort algorithm . And in fact, it's relying on something that we're going to come back to, called the loop invariant.

    恩,这是一个很棒的小搜索,抱歉,和很棒的小排序算法,事实上,它依赖于一些我们要回顾的东西,被称作循环不变量

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

  • You can only use the state variables independent of history.

    你只能使用依赖于历史的,状态变量

    麻省理工公开课 - 热力学与动力学课程节选

  • Very good. Certain things are called invariants.

    非常好,这些量就叫做不变量

    耶鲁公开课 - 基础物理课程节选

  • You don't have to declare a special variable for it if you don't care about its actual value.

    你并需要为它声明一个特定的变量,如果你关心它的实际值。

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

  • If you're not updating some variable by incrementing it or decrementing it -- if you're not changing anything, presumably the conditions are never going to evaluate to false or the opposite, so you're just going to have an infinite loop, which might be your goal, but odds are it's not.

    如果你通过增加或减少它来改变一些变量,-如果你改变什么,大概那个条件永远会变成错误的,或相反的,所以你将得到一个无限循环,那可能是你的目标,但可能也是。

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

  • I don't know what the names of the variables are, I don't care, I can basically suppress away that detail.

    在solve函数中使用了些什么值,我知道里面的变量的名称,我可以简单的跳过这些细节。

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

  • I don't want to have so many variables around.

    希望式中有这么多变量

    麻省理工公开课 - 热力学与动力学课程节选

  • Right, so the fact that everything is indented means while 2 we're doing, while the variable is not equal to 2, keep doing this.

    事实上缩进意味着,如果变量等于,就重复我们现在所做的这个过程。

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

  • This is an example of an invariant.

    这是一个不变量的例子

    耶鲁公开课 - 基础物理课程节选

  • I declare a variable called n. I'm not giving it a value yet, so I had better be careful.

    我申明一个变量n,我先给它赋值,所以我最好小心点。

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

  • But here, if I decide I'm going to store things not in x and y, but with some other set of names, for example, I've gotta go back into these pieces of code that use the points, and change them. So I've lost modularity.

    除了要改下借口,但是这里,如果我决定,我把值放在x和y中,而是和其他一些变量名进行绑定,例如这样的话,我就得回到使用这个点的代码,那儿去做更改了。

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

  • But notice unlike a for loop, if you want to declare a variable or increment or decrement to variable, you've got to do that yourself.

    但请注意像for循环,如果你想声明一个变量,或者变大或变小一个变量,你需要自己完成。

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

  • The loop invariant what does the loop invariant mean? It says, here is a property that is true of this structure every time through the loop.

    循环不变量是什么意思?,它是一个在结构体中,每次循环都为真的属性。

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

  • What if I don't change the value of that variable inside of the code?

    那么如果在循环内部,我改变这些变量的值会怎么样?

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

  • We've seen in class that you get garbage values if you don't initialize something to a value so let me actually initialize x to a value.

    我们在课程上了解到,如果你给一个变量,进行赋值,它会获得一个无效值,让我把x初始化为一个值。

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

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

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

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