Or another way of saying it is, we're going to use as the basic steps, those operations that run in constant time, so arithmetic operations.
我们用可以在恒定时间内完成的操作,算法,比较,内存读取。
Good question, so there is this little reading head kind of like in an old phonograph player that does move back and forth and in and out depending on the implementation.
好问题,这就像,老留声机里的小读头,它通过来回移动,来完成不同的操作。
hey'd rather single step it through using Idol or something, than just read it and try and figure things out. The most important thing to remember when you're doing all of this is to be systematic.
比起阅读代码发现错误来他们,宁愿用内置的操作层,或者其他工具一步完成,你要记住的最重要的事情,就是要系统化的去做调试。
Seven comparisons, right?
是我花了多少次操作来完成这件事?
As I said, I would prefer to do something that uses an accessor that I just wrote.
来完成这个操作,因此p,Cartesian是一种访问器,它可以访问里面的数据。
I should use Cartesian or polar to pull out those pieces of it.
或者polar方法来读出这些值,一旦我完成了以上的操作。
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次基本操作,来完成这个循环。
应用推荐