• And I'm going to show you an example in a 1 second, just to drive this home, but notice the characteristics. In the first two cases, the problem reduced by 1 at each step.

    在前面两个例子里,每一部问题的规模缩小了,不管是迭代的还是递归的,这表明这个问题的复杂性可能是线性的。

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

  • OK. I know. It looks boring. But it's a structure of the things I want to think about when I go through trying to take a problem and mapping it into a iterative program.

    好,我知道这看起来有点无聊,但是这是我要去以迭代的方式,去解决一个问题采取的,措施的大致结构。

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

  • > So now that might not have felt like the fastest algorithm but think about what you could have done with that algorithm in each iteration, much like the phonebook up front here, you literally split that problem in two because on each iteration roughly half of you were sitting down and then another half and then another half.

    虽然这并不是最快的算法,但如果把这种算法每次迭代,就像刚才查电话簿一样,你便将这个问题一分为二了,因为每一次迭代后只有一半坐下来,以此类推。

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

  • Once you hear that description, it's easy to write the code, in fact. This is a place where the recursive version of it is much easier to think about than the iterative one.

    实际上一旦你听到了大致描述,就能很轻松的写出代码来,在这一点上应用递归来解决问题,比用迭代要容易理解多了。

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

  • If I want to try and decide how to tackle a problem in an iterative matter, here the steps I'm going to go through. First thing I'm going to do, is I'm going to choose a variable that's going to count.

    但是这就是我对它的观点,如果我试着去以迭代的方式,解决一个问题的话,下面是我应该采取的步骤,第一件要做的事情。

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

  • Again, what I want you to see is, notice the characteristic of that.

    这里面的特征,也就是迭代产生了两个小一号的问题

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

  • So if on each iteration of merging I'm doing eight things or more generally, N. That then begs the question, how many levels of this tree are there actually?

    可见对于合并我需要迭代8次,一般情况下是N,这取决于具体问题,那么在这棵树中一共有多少层呢?

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

  • All right. So it's fun, and I got a little bit of applause out of it, which is always nice for me, but I also showed you how to think about it recursively.

    好,挺有趣的,我也得到了一点掌声,这让我挺高兴的,但是我想让大家明白,怎么用迭代的思想来解决这个问题

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

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

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

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