So wherever the largest element started out in the list, by the time I get through it, it's at the end.
所以无论最大的元素,在列表的什么位置。
And I have this, to write it out, this is order the length of the list squared, OK?
我得写下来,这是把列表的长度平方,对么?
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 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?
结果是你可以列举一个,给它取个名字,如果你使用方括号,那是告诉编译器,在里面我需要许多的值--在这些变量里,我怎么做到的?
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.
我们来检查检查,我写了一个小测试脚本,我写这个脚本来测试单元排序,它能够打印出每一轮结束后,链表的是什么样子的。
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?
所以为了引导下一次,我们要讲的内容,如果我想做排序,而且不是一次吧整个列表排完,会发生什么,我把它拆成小的列表,然后把各个小列表排序,接着用高效的方法再把小的列表?
应用推荐