And I want to remind you, that block of code is a set of instructions, the same set of instructions that are going to be done each time through the loop.
我想提醒大家,这块代码是一个指令集,一个每次循环都会被执行的相同指令集,会变化的仅仅是变量的值。
So each time through the loop, I'm doing three steps. Three basic operations.
因此每次运行这个循环,我做了三次基本运算。
Last time we worked through this idea of the scale and how you can build triads on each of the members of the scale.
上节课我们已经讨论过音阶中的这个概念,以及你们怎样才能在音阶的各个音上组建起三和弦。
I've got a list, walk you through it an element at a time, do I look at each element of the list more than once?
你一次只能得到他的一个元素,我是不是把数组里面的每个元素,都过了大于等于一次?,你不这样认为么?大家有什么建议?
It's basically cycling through the loop a multiplying by a each time.
这个代码就是简单的循环,每次乘一个。
b times. So I've got to go 3 b steps. All right I've got to go through the loop b times I've got three steps each time, and then when I pop out of the loop, I've got two more steps. All right I've got the initiation of answer and the return of it.
好,我一共执行了b次循环,每次循环内部进行了三次基本操作,当跳出循环后还有两个基本操作,因此这个初始的答案就是,2+3b次基本操作,来完成这个循环。
应用推荐