So do reach out ultimately to your assigned teaching fellow, to me, to the help list, to the forums online.
所以务必联系到你们的研究生助教,到我这,到那个帮助栏,到在线论坛上。
So wherever the largest element started out in the list, by the time I get through it, it's at the end.
所以无论最大的元素,在列表的什么位置。
Well, notice again, on each level of the tree, when I actually do the merging, so this remember, is when I wrote down just the numbers when I bottomed out with the list of size 1.
请注意,在这棵树中的每一层,我真正做合并时,就将每个大小为1的列表中的,数字写下来。
There are all kinds of things that it might be very useful ; for you to know as an inhabitant of Western civilization; and the New Testament,you might find out, would rank kind of down on the list of those kinds of things.
作为西方文明的一分子,有很多有用的东西可以学;,而新约,你会发现,与这些东西相比,排名比较靠后。
So, I wrote some very simple software to receive an email from my BlackBerry and then send it out to an email list of some people I put on that list, with my friends and my family on it.
所以我编写一些很简单的软件,来接收我的黑莓手机发来的邮件,然后将其转发给一个邮件列表,这个列表上有我的朋友和家人。
It turns out that there's lots of proteins that have value as therapeutics and there's a list of them here and some of them you'll recognize.
我们已经发现很多有药用价值的蛋白质,这里有一张相关列表,其中一些你能认出来
I put on the reading list The New Yorker article that's out right now.
在阅读材料上有篇最近《纽约客》上的文章
You will be given a list of pieces that you'll have to prepare for a little bit and then we will play out of those particular pieces, but most importantly, I will give you a prep sheet.
回头我会给你们一个作品片段的列表,你们得做点准备,然后我们会放一些列表中的作品片段,但是最重要的是,我会给你们一些考点
And again, this points out something I wanted to me-- I mentioned last time, list can be heterogeneous, in the sense that the elements can be multiple different types.
这儿又指出了一点我想要告诉大家的,我上节课也提到了,就是数组是多相的,也就是说元素可以是多种类型的。
The last thing I want to point out to you is, I started out with this list. I haven't added anything to the list, right? I mean I've got a different kind of looping mechanism.
我们从这个列表开始,我没往这个列表上加任何东西对不对?,我的意思是我学会了一种不同种类的,循环机制,我想我得说。
And I have this, to write it out, this is order the length of the list squared, OK?
我得写下来,这是把列表的长度平方,对么?
Let's check it out. I've written a little bit of a test script here, so if we test cell sort, and I've written this so that it's going to print out what the list is at the end of each round, OK.
我们来检查检查,我写了一个小测试脚本,我写这个脚本来测试单元排序,它能够打印出每一轮结束后,链表的是什么样子的。
It turns out you can list one, give it a name, and if you use square brackets, that tells the compiler I actually want to put multiple values inside of this -- inside of this variable and how do we do that?
结果是你可以列举一个,给它取个名字,如果你使用方括号,那是告诉编译器,在里面我需要许多的值--在这些变量里,我怎么做到的?
How do I figure that out? Well I'm looping down the list, right? I'm walking down the list.
怎么算出来的呢?我在循环遍,历这个列表对吧?那要遍历这个列表。
I'll just draw out sort of a funny representation of a list.
挺有趣的关于数组的比喻,这有点像脑细胞。
I just go down the list selecting the smallest person at a time and then I repeat, repeat, repeat but when we actually did out the math or kind of reason through it, the running time, the asymptotic running time of bub-- of Selection Sort was also what?
只需要遍历列表,每次找出最小的元素,然后重复上述步骤,但从数学角度看,选择排序的时间复杂度,又是多少呢?
It took me seven comparisons, because I can take advantage of the fact I know I only ever have to look at the first element of each sub-list. Those are the only things I need to compare, and when I run out of one list, I just add the rest of the list in.
进行了7次对比,因为我可以利用我知道的优势:,每次只需要比较每个子列表的第一个元素,那才是我需要进行对比的内容,当一个列表的元素处理完了,只需要将另一个列表剩下的元素直接添加进去。
I think the easiest way to look at what this does, is let's take a really simple example- I want to make sure I put the right things out- I've got a simple little list of values there.
到底做了什么,就是让它跑一个简单的例子,我想要确信我找到了正确的元素-,这里我用一个简单的小的列表-,如果我去代码里面看。
So to just preface what we're going to do next time, what would happen if I wanted to do sort, and rather than in sorting the entire list at once, I broke it into pieces, and sorted the pieces, and then just figured out a very efficient way to bring those two pieces and merge them back together again?
所以为了引导下一次,我们要讲的内容,如果我想做排序,而且不是一次吧整个列表排完,会发生什么,我把它拆成小的列表,然后把各个小列表排序,接着用高效的方法再把小的列表?
We can put a list in the list again, as we've seen before. So let's put the list containing the string a, and I'll print out so now we see something pretty interesting about a list, that we can mix up all sorts of things in it, and that's OK.
数组放到数组中去,让我们把这个包含,字符串a的数组放进去,然后再显示,我们看到了一些,挺有趣的事情:我们可以把各种,各类的东西混合着放进去,没问题。
应用推荐