Of course there are lots of ways we can execute the cycle, but this is a simple one, and these are steps that we're all familiar with at this point.
当然循环过程,可以有很多种方法,这是一个简单的例子,这是循环过程,循环中的每一步我们都很熟悉。
Figure out what I'm trying to walk through What's the collection of things I'm trying to walk through. Figure out what I want to do at each stage. Figure out what the end test is.
弄清楚需要遍历的东西,弄清楚我需要遍历的东西的集合,弄清楚我在每一步该做什么,弄清楚终结测试。
It's reversible, that means that p external, equals p. I'm doing it very slowly so that I'm always in equilibrium between the external pressure and the internal pressure so I can go back and forth.
我都可以不损失能量,而把过程逆向进行,整个过程中的,每一步都保持平衡,现在我们来分别。
Now I am going to break this into elementary steps and look at the relative contributions.
我会把这整个变化过程化为几个基本的步骤,去考察每一步的变化量。
Again, I'm repeating a theme that is in my book, New Financial Order, that financial innovation and insurance innovation is a succession of inventions and each invention propels the idea more forward.
我要再一次强调我的《金融新秩序》,这本著作的主题之一就是,金融创新与保险创新,是前后相继的一系列创新活动,每一步创新都推动着保险理论向前发展
And when you're switching n's, you're actually getting quite a bit farther away.
而当你改变,n,的大小时,实际上每一步你都会变远了很多。
I'll look at the rest of that big chunk of the list, and that's a pain.
因为这样每一步,都可以保证,排除当前数组的。
now let's go back to each of our individual steps and look, based on what we know about how to evaluate the thermodynamic changes that take place here, let's look at each one of the steps and see what happens.
让我们回到循环中的每一步,然后看看,基于我们已有的知识,来估计一下,发生的热力学变化,让我们看,循环中的每一步发生了什么。
Count the number of primitive operations in each step.
数一数每一步中的基本操作,好的,如果我们看看这段代码。
Every step won't be perfectly reversible.
每一步都不会是完全可逆的。
We're checking the end test and incrementing, actually I was going to, I commented that out for a reason you'll see in a second, but I, normally I would keep this on, which would let me, at each step, see what it's doing. If I ran this, it would print out each step. Which is helping me make sure that it's incrementing the right way.
对不对?进行终结测试然后递增,实际上我要,因为某些你们,马上要明白的原因我把这里注释了,但是我通常会一直这么做,这样能让我看到每一步都做了什么,如果我运行这个程序,它会在每一步都,进行显示,这能帮助我让我确信程序是,在以正确的方式递增。
Getting rid of half at each step.
每一步把空间缩小一半。
With this, if I can assume that accessing the i'th element of a list is constant, then you can't see that the rest of that analysis looks just like the log analysis I did before, and each step, no matter which branch I'm taking, I'm cutting the problem down in half.
读取数组中的第i个元素,是个常量时间的操作的话,我也就能像以前那样得到,这个算法是对数级复杂度的分析,并且每一步不管我选择哪个区间,我都可以把问题的规模缩小一半。
应用推荐