That got split in half, and that got split in half until I got to a list of one.
在那里被分成两半,然后在那里被分两半,直到得到长度为一的列表。
Still quadratic, right? I'm looking for the worst case behavior, it's still quadratic, it's quadratic in the length of the list, so I'm sort of stuck with that.
还是平方,对吧,我在寻找最坏的情况,它还是平方,它是列表长度的平方,我对此有点无奈了。
We talked about the inevitability of death; we talked about the variability, that people have different lengths of time before they die.
我们讨论过了死亡的不可避免性;,我们讨论过了其可变性,不同的人在他们死之前有所的时间长度不同。
At atomic length scale, limits on our ability to observe.
在原子长度问题上,我们的观察受限。
So what we do is we pick an origin, call it zero, we put some markers there to measure distance, and we say this guy is sitting at 1,2,3,4,5.
我们现在选择一个原点,称其为零点,我们做一些标记来测量距离,这个点在五个单位长度的地方
And in this context, the length of that array is stored in Arg C. Well, let's take a look at a slight variance of this that reveals further what we can do and reveals what a string really is.
关于这点,那个数组的长度被存储在ArgC中,好的,让我们看看这个轻微的变化,那个揭示了我们可以做的,和字符串实际上是什么。
And I know it's kind of, you can see it on your handout, it has the rest of the pieces over here.
我可能会去求它们的长度,我知道这有点儿,你们可以在课堂手册上看看。
The second question I want to ask is what's the base case? When do I get down to a problem that's small enough that it's basically trivial to solve? Here it was lists of size one. I could have stopped at lists of size two right. That's an easy comparison.
第二个问题是什么是基础条件?,我要将问题分解到何时才使得问题,小到可以解决的基本问题?,这里是当列表的长度为1有时候,我也可以在长度为2的时候停止分解,那是一个非常简单的对比。
It's not true, by the way, of all programming languages. In fact, Professor Guttag already talked about that, in some languages lists take a time linear with the length to get to it.
顺便说一句这在大部分,编程语言中做不到,实际上Guttag教授已经说过这一点了,在一些语言中取得数组,要花费时间是线性长度的。
Down here, I've just got two things to merge, and then I've got things of size two to merge and then things of size four to merge. But notice a trade off. I have n operations if you like down there of size one.
但是n的大小是不同的,是吗?在这里我们只要合并两个元素,然后是合并长度为2的列表,接下来是合并长度为4的列表,但是观察一下之间的权衡关系。
应用推荐