Any thoughts? Don't you hate professors who stand here waiting for you to answer, even when they have candy?
你们难道不讨厌站在那儿等你回答问题,的教授么?虽然他有糖果做奖品哦,用少于线性时间完成可能么?
Well if I-- you know, with let me say it differently. I don't need to worry about how checking is done, it's handled inside of that function.
好,如果你们知道,抱歉,让我们换种说法,我不必担心检查工作,是则会么做的,这是在方法体内部进行的。
Anybody's mother make Jell-o with fruit in it?
有谁的妈妈也做过这种果冻么
So did you approach Professor Katz and say "we have this idea we really would like to promote"? At least a discussion and the academic study of what it looks like.
那你是主动联系Katz教授,跟他说,我有这样一个想法,我们很想推行么?,至少讨论,并且做了学术上的研究,了解课程的内容。
So this is a place where the amortized cost actually helps me out. And as the gentleman at the back said, the question he asked is right, it depends on what I'm trying to do.
开始起了作用,我们要分析的话,我要想一想我在做什么,我抓住了每一点么?
OK? Because what am I doing? It's called bubble sort because it's literally bubbling along, right?
明白了么?你要知道我在做什么,冒泡排序真的就像冒泡,对么?
So first of all, I've got to be careful about the end test. But the second thing is, OK, if it stops whenever this is less than two, am I convinced that this will always halt?
小心最后一次比较,其次,如果少于两个元素程序停止了,我们能确信这总是应该终止的么?,答案是肯定的,因为我在做什么?
Oh wait a minute, that's a little different than what we did last time, right?
这同我上次做的有点不同了,是么?,上一次我们检查了输入?
OK. What's this thing doing then, in terms of sorting?
这是在做什么呢?排序么?,在第一遍结束的时候?
OK. Could we do better in terms of sorting?
我们在排序上可能做的更好么?
Once each time. Right? I only do one swap potentially, it-- though not one potentially, each time at the end of the loop I do a swap.
每次循环做一次,对么?我其实,就可能做了一次交换,也许并不是可能,每次循环的结束我都得做一次交换。
Another way of saying it is, I can do this stop when I don't need to. All right?
另一种说法是,我能够停下来,当我不需要做的时候,对么?
All right? Because if I don't do any swaps on a pass through the algorithm, then it says everything's in the right order.
好么?因为如果我,这一遍没有做任何交换,那么就意味着已经排好序了。
I'm going to tort-- I'm going to make the font smaller so we can see more.
我们还没看到比较结果,好,你知道我要做什么了么?
Otherwise, this is going to be doing something strange, but all integers?
否则,程序会去做一些,奇怪的事情,但是是所有的整数么?
Meaning, sometimes you need to do this, but in general there's at least in my view and I don't, John you just don't want to do this.
意思也就是,有的时候你不得不这么做,但是通常来说,至少我认为不该这么做,你同意这么做么?--,John,,would,you,agree?—,你不该这么做。
应用推荐