• In binary search-- ah, there's that wonderful phrase, this is called a version of binary search just like you saw bin-- or bi-section methods, - when we were doing numerical things- in binary search, I need to keep track of the starting point and the ending point of the list I'm looking at.

    就是当我们处理数字的时候,所称的二分检索,在二分法搜索,我需要记录区间的开始点尾点,初始化的时候就是-,问题输入的开始点尾点,当我开始做测试的时候,我想要做的就是去取点。

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

  • It says, well I'm going to print out first and last just so you can see it, and then I say, gee 2 if last minus first is less than 2, that is, if there's no more than two elements left in the list, then I can just check those two elements and return the answer.

    然后它计算了尾点开始点的差,如果小于2的话,也就是说数组的元素小于等于,我对这两个元素进行比较,然后返回结果就可以了,否则的话,我们就去寻找点,注意它是怎么实现的,首先这个指向一个列表的开头。

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

  • Right? In other words I've got the stoichiometric coefficients in there and the values, and I'm subtracting the reactants from products -1652kJ/mol wind up with minus 1652 kilojoules per mole.

    对吧?换句话说这里我用了化学,计量系数生成热的,从生成物减去反应物,最后得到。

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

  • That's different when you have continuous values-- you don't have P because it's always zero.

    离散型随机变量的分布不同的是,连续型随机变量的分布,某一点的概率始终是零

    耶鲁公开课 - 金融市场课程节选

  • And actually, if I don't want to clobber, as we say, overwrite the value of my variable, ; I could declare another one and store the return value in Y; Y so now I have two ints in memory; X and Y, 3 one with two, one with three.

    实际上,如果你不想彻底清除,像我们说的,覆盖那个变量的,我可以申明另一个变量Y,并在Y保存那个返回;,现在内存有两个int数,X,一个的为2,一个为。

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

  • Initially, it's the beginning and the end of it.

    然后根据目标数的比较结果。

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

  • But that little short hand there is doing exactly the same thing. It is adding that value into some digits and putting it back or signing it back into some digits. And I'll walk through that loop and when I'm done I can print out the total thing does. And if I do that, I get out what I would expect.

    加上得到的这个数的,但是这个缩写声明其实是进行了同样的操作,它把我们得到的这个数加到一个数上面去,然后用对这个数进行了重新赋,在循环会去遍历字符串,当完成循环后,程序会显示数字的总,如果我运行,这个程序的话,我会得到我期待的结果。

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

  • I'm going to say, gee, p2 is the x value the same in both of them, and if it is, and the y value's the same, then this is the same point, I'm going to return true.

    这样的数据对象,我会把它们命名为p1,我会去查看,看看两个对象,的x是不是相同,如果相同的话,就去查看y是否相同。

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

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

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

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

  • In either case, I take that value and multiply back by two, if it was even I get back the original number, if it was odd, I'm not going to get back the original number, so I can just check to see if they're the same.

    在两种情况,我都把结果,再乘以2,如果x是偶数我就,得到了原来的,如果x是奇数那么就不会得到,原来的,因此我看看得到的,原来的相等不相等就可以了。

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

  • You have to with C, as with a lot of programming language, say what you return.

    在C语言大部分语言,你必须说明函数的返回

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

  • So you see why I say it's a template, right?

    然后通过这两个赋声明,在cp2内置了xy

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

  • So the question was, why is this return down at this level, it says, well if I ever execute out of this FOR loop, I get to the end of the FOR loop without hitting that branch that took me through the return, then and only then do I want to actually say, gee, I got to this place, there isn't any value to return, none I'm going to return none and none.

    问题是,为什么它是在这个级别上返回呢,意思就是如果我出了这个for循环,就意味着我运行的过程没有走到任何,带return的支路上去,这时也只有这时我才能说天呐,我终于走到这儿了,这时不会返回任何,只会返回none

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

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

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

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