Now formally I could have had this pointing off to another object containing 4, but that just seemed excessive, right?
当然我可以正式的把它指向,另外一个含有4的对象,但这有点多余对不对?
So finger-pointing at the start of each list, 6 is indeed less than 8 so I'm gonna write it down first.
手指指向列表的开始,6肯定比,8小,我先把它写下来。
And if the test is true, it will change the value of this program counter to point to some other place in the memory, some other point in that sequence of instructions, and you'll keep processing.
如果测试结果为真,它会改变程序计数器的结果去,指向记忆存储器里的其他地方,指令序列里的其他地方,然后你会继续这个过程。
Then the acceleration of the planet is the force of gravity between the planet and the Sun, which Newton will tell you is directed towards the Sun and it depends on how far you are.
行星的加速度源自,行星和太阳之间的作用力,牛顿认为这个力指向太阳,它的大小取决于行星离太阳有多远
Instead if we want this pointer to represent the address of something in as much as it points at that address let's just draw an arrow.
如果我们想要让这个指针表示,数据的地址,它指向的地址,我用一个箭头表示。
Just point at the start of this list, and this one so which number comes first?
指向列表的开始处,对于它来说,哪个数字在前面?
> Okay. Well, this code allocates a new integer pointee and this part sets x to point to it.
>,好的,呃,这段代码分配一个新的整型指针数据,这部分让x指向它。
Now I look at that element. Is it the thing I'm looking for? If I'm really lucky, it is. If not, I look at the value of that point here and the thing I'm looking for. And for sake of argument let's assume that the thing I'm looking for is smaller than the value here.
现在我们瞧瞧指向的元素,它是我们找的值么?如果足够幸运,他就是,如果不是,我们比较指向的元素,同我们要找的元素,方便起见,假设要找的元素比这里的值要小。
It's pointing at a different place in the heap.
它在堆中指向不同的地方。
So it's now pointing to the end of the list.
现在它指向列表的末尾。
Advance this pointer-- this finger, to the next element of the list which is 4, make the comparison.
前移这个指示器--也就是这根手指,让它指向列表中的,下一个元素4,再做比较。
Don't think of it as a specific box into which we're putting things; think of it as a link to a value.
别把它想做是,我们放东西的一个箱子;,把它当做是一个指向值的链接。
self First argument by convention is always self, because it has to point to the instance, and then I pass, in this case, another couple of arguments in.
第一个参数往往是,因为它必须指向实例,然后我传入了,在这个例子中。
It says, well I'm going to print out first and last just so you can see it, and then I say, gee 2 if last minus first is less than 2, that is, if there's no more than two elements left in the list, then I can just check those two elements and return the answer.
然后它计算了尾点和开始点的差,如果小于2的话,也就是说数组中的元素小于等于,我对这两个元素进行比较,然后返回结果就可以了,否则的话,我们就去寻找中值点,注意它是怎么实现的,首先这个指向一个列表的开头。
When a particle moves in a circle, it has an acceleration towards the center of this size, v^2 over R.
当一个质点在圆周上运动时,它有一个指向圆心的加速度,v^2 / R
Once I've got that, I can now start giving some variable names, sorry not, rephrase that, I can give some attributes, I can give some characteristics to these classes.
还有个指向内存中地址的指针,我还可以命名这个指针,因此cp1和cp2都是,指向它们的指针,一旦我创建了它类,我就可以开始赋予。
And then it needs to have access to that, so it calls it, passing in self as the pointer to the instance.
把self作为指向这个实例的,指针传了进去,也就是,它的意思是现在。
OK. What does that say? I'm going to change MinIndex min index to also point there n value is 8, j starts off here, and I say, OK, is the thing I'm looking at here smaller than that? Yes.
好的,这意味着什么?,我打算交换,让它也指向那里,MinVal是8,j从这里开始,我要找的值比这个小么?是的。
Let's point it that way and call it F2 on 3.
它指向这个方向,名叫 F23
应用推荐