We'll start up a shell and we'll try it. All right, we'll just get out of what we were doing here.
我们开一个shell然后试试,先退出现在的这个来。
All right. So let me start again by reminding you what it is that was done last time.
好的,我们开始上课,先回顾下上节课的内容
OK. Let's simulate the code. Let's see what it's doing here. All right, so we start off.
让我们看看这里到底做了神马?,好的,我们开始吧。
So if you need the help of the notes it's in there but I would urge you to work through it on your own, and it's the following: let's start with the same path A, all right?
如果你需要帮助,可以去看讲义,但我还是希望你们自己去推导它,它是这样的,让我们从:,相同的路径A开始,好吗?
All right? A linear search, I start at the beginning of the list and walk all the way through it. All right, if I'm lucky and it's at the low end, If it's not, if it's at the far end, I've got to go forever, and you saw that last time where this thing paused for a little while while it actually searched a list this big.
如果很幸运就在开头,那运行起来很快,如果是在末尾,那就一直得走到头,上次看到了,如果搜索空间很大,程序都会暂停一会,好的,那我希望你们。
All right. If that sounds like a really long preamble, it is. Let's start with Python.
好,如果上面听起来像一个很长的序文,他确实是,让我们从Python开始。
It's going to let j run over the length of the list all right, so it's going to start at some point to move down, and then it's going to let i run over range, that's just one smaller, and what's it doing there?
就在这里,会做什么呢?,我们让j遍历这个列表,好的,它要从某一定开始移动,然后让i也跑遍整个范围,就是比之要小一,会发生什么?
应用推荐