With simple branching, how long is it going to take to run a piece of code?
但是在简单分支程序中,执行一个程序,要多长时间呢?
So we want to write programs to do that.
为了实现这一目标我们要去写一个执行程序。
Simply walk down that list.
执行一个直线序列的程序。
Now this happens to be what we would call a linear process, because the number of times I go around the loop is directly related to the size of the argument. If I double 2 the argument, I'm going to double the number of times I go around the loop. If I increase it by five, 5 I'm going to increase by five the number of times I go around the loop.
这恰好是我们会成为,线性复杂度程序的一个例子,因为我要执行循环的次数是,和输入的参数的大小直接相关的,如果我将这个参数乘以,那么我就要将进行循环的次数也乘以2了,如果我把参数加上,那么循环的次数也要加上5了。
But literally all I can do at this stage is write what we would call a straight-line program, that is, a program in which we execute in which we execute the sequence of instructions one by one.
但是字面上来说,我们现在学到的,都是所谓的直线程序,也就是,一个接一个的执行,一系列的,指令的程序。
应用推荐