• First, it's pointing to the beginning of the list, which initially might be down here at but after a while, might be part way through. And to that, I simply add a halfway point, and then I check.

    列表中间的一个部分了,然后我求出列表的中点,然后看看该点的是不是等于目标,如果是的话就完成了,如果不是的话,如果中位大于我要找的目标

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

  • I'm walking along the list once, taking two things and saying, make sure the biggest one is next.

    我遍历一次列表,每次取两个,确认最大的元素在后面一个。

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

  • 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的话,也就是说数组中的元素小于等于,我对这两个元素进行比较,然后返回结果就可以了,否则的话,我们就去寻找中点,注意它是怎么实现的,首先这个指向一个列表的开头。

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

  • I look at the rest of the list, but I've changed the value.

    我们再来看看其余的列表,我已经改变的

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

  • To get any location in memory, to get to any value of the list, I simply have to say which element do I want to get, I know that these things are stored in a particular size multiply that index by 4, add it to start, and then it's in a constant amount of time I can go to that location and get out the cell.

    取得列表中的任何一个,简单说来,想要取得列表中的任何元素,我知道这些元素存在特定的大小中,把下标乘以4,加到start上,然后定位到内存单元,并取出就是固定的时间了,好的,如果元素以固定大小存储。

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

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

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

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