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.
每次循环做一次,对么?我其实,就可能做了一次交换,也许并不是可能,每次循环的结束我都得做一次交换。
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.
开始起了作用,我们要分析的话,我要想一想我在做什么,我抓住了每一点么?
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教授,跟他说,我有这样一个想法,我们很想推行么?,至少讨论,并且做了学术上的研究,了解课程的内容。
OK? Because what am I doing? It's called bubble sort because it's literally bubbling along, right?
明白了么?你要知道我在做什么,冒泡排序真的就像冒泡,对么?
I'm going to tort-- I'm going to make the font smaller so we can see more.
我们还没看到比较结果,好,你知道我要做什么了么?
Oh wait a minute, that's a little different than what we did last time, right?
这同我上次做的有点不同了,是么?,上一次我们检查了输入?
应用推荐