什么是环?
What we do is, in a loop, march down the argument list checking each one to see if it is an option.
我们所做的是,用一个循环遍历参数列表检查每个参数来看它是否为选项。
The comments in Listing 5 merely tell the reader what the code is doing - that it's iterating through a loop or that it's adding a number.
清单5中的注释仅告诉读者代码在做什么—它正在通过一个循环进行迭代或添加一个数字。
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了。
应用推荐