You'll also notice that this thing goes through the entire list, even if the list is sorted before it gets partway through.
你也能注意到,它始终会遍历列表,甚至列表在排序之前,就是有序的也是这样。
to validate the entire radio before it is released to the public.
以便在对外发布之前把所有的广播功能都测试一遍。
I have the skeletal structure written up there, I've written it twice and you'll see why in a minute.
我已经把它的骨架结构画在上面了,我画了两遍,等会你就会知道为什么。
Now you might say, wait a minute. Thing's ordered, if I stop part way through and I throw away half the list, doesn't that help me? And the answer is yes, but it doesn't change the complexity.
如果我在半路上停下来,然后不去遍历剩下的数组了,这会有帮助么?答案是有帮助,但这没法改变算法的复杂度,因为我们之前怎么说来着?
But this is mirrored by Sal's very specific investment in Dean, and this is on the bottom of the facing page, on 189: Resolutely and firmly I repeated what I said.
不过也反映了萨尔对迪安非常具体的付出,在这页189的底部:,我加重语气重复了一遍我说过的话。
Quickly to reread it--I know that you all have it glued to your wrists, but in case you don't, I'll reread it: I am Tony the Tow Truck. I live in a little yellow garage.
我快一点复述一下--我知道你们肯定都读过了,但是以防万一有人没读过,我还是要重读一遍:,我是拖车托尼,我住在一间狭小的黄色车篷里。
Because we are on tape I'll repeat any questions that come in.
因为我们的课在录音,所以我要把问题重复一遍。
Now, I look around this room, I don't see anybody whose head is three times bigger than mine, so I know that you cannot digest everything the books have.
我在教室里扫了一遍,没看见谁的脑袋比我大三倍,我知道你们是不可能看完这本书的
The cell that's producing the signal produces enough of the molecule so that it enters the bloodstream, it circulates throughout your body, eventually it reaches a cell at a great distance, which has a receptor for that ligand and the signal gets received.
发出信号的细胞产生信号分子,数量十分充足 能够进入到血液中,信号随着血液流遍全身,最终到达较远处的细胞,在这些细胞上有与配体配对的受体,信号被细胞接收
Now this is-- again, testament to the fact that computers, you know, sophisticated or scary as they might seem to some, they're pretty stupid devices.
我再说一遍,事实上,电脑,你知道的,在某些人看来,很尖端,很高科技,其实它很笨的。
Back in 1988, when we started this study, we asked realtors around the country, what is the hottest market in the United States?
回溯到1988年,那时我们刚开始这项研究,我们问遍了整个国家的房产中介,在美国最炙手可热的市场是哪里
As you walk amid the buildings and trees, as you see your friends and classmates, allow these emotions to float through you, freely, lightly.
在你走在建筑物和树木之间时,在你看到朋友和同学时,让那些情绪流遍你的全身,自由地,轻盈地。
I'll do this again, not this whole lecture but that part again-- and he did it because you can't build barricades across boulevards, wide ones.
就这个部分,我会再讲一遍的,他如此做的另一个原因是,在这种宽大的街道上是无法建造街垒的
The third movie is Snow White, which I haven't gone out to see, but my 4-year old daughter has seen on 24 of the last 27 nights on video.
第三部《白雪公主》我还没有看过,但我4岁的女儿在27个晚上看了24遍
And hopefully on your paper, I think I should probably re-draw mine here.
希望在你的纸上,我想我还是把我的在这再写一遍吧。
google Imagine you want to search through Google to find a particular page. You want to do it in a second. And you're going to just do it the brute force way, assuming you could even reach all of those pages in that time.
假设你想通过,搜索一个特定的网页,你想在1秒内得到结果,然后你就只管去做了,认为能在1秒内遍历遍所有的网页。
I'm walking along the list once, taking two things and saying, make sure the biggest one is next.
我遍历一次列表,每次取两个值,确认最大的元素在后面一个。
So in the first case, I didn't have to do any swaps because 1 was the smallest thing.
所以在第一次遍历中,我没有做,任何的交换因为1就是最小的。
Figure out what I'm trying to walk through What's the collection of things I'm trying to walk through. Figure out what I want to do at each stage. Figure out what the end test is.
弄清楚需要遍历的东西,弄清楚我需要遍历的东西的集合,弄清楚我在每一步该做什么,弄清楚终结测试。
And that you might look at, for example, that first example, and say, man by this stage it was already sorted, yet it had to go through and check that the third element was in the right place, and then the fourth and then the fifth and then the six.
你可能会去看看例如第一个例子,然后要抱怨,到这里,它已经是排好序的了,但他还是得去遍历查看,第三个元素是不是在正确的位置,然后第四个,第五个,第六个。
OK. What's this thing doing then, in terms of sorting?
这是在做什么呢?排序么?,在第一遍结束的时候?
In the second case, I found in the next smallest element and moved here, taking what was there and moving it on, in this case I would swap the 4 and the 8, and in next case I wouldn't have to do anything.
在第二次遍历中,我找到了,第二小的元素,把它移到这里,把这里原来的元素移到哪里,在这一次遍历中,我会把8和4交换,然后一次遍历,不会做任何事情。
If it's there, I'm done, if not, I keep walking down, and I only stop when I get to a place where the element I'm looking for is smaller than the value in the list., in which case I know the rest of this is too big and I can stop.
并且保持遍历,我只在当当前位置的数组元素,大于目标数时停止,这意味着剩下的元素都比目标元素大,但是其他的情况,我还是要遍历完整个数组。
How do I figure that out? Well I'm looping down the list, right? I'm walking down the list.
怎么算出来的呢?我在循环遍,历这个列表对吧?那要遍历这个列表。
What's this thing doing? It's walking along the list looking for the smallest thing in the back end of the list, keeping track of where it came from and swapping it with that spot in the list. All right?
这是在做什么?是在遍历列表,找列表后端最小的元素,跟踪它从哪里来的,然后同当前点的元素交换,明白了么?
So the first one here is something called insertion sort which amounts to going through the list, taking the first thing that you see and inserting that element into its correct place, - then moving on to the next one, dealing with what element-- whatever element you're given and putting it in its right place.
首先是插入排序,在此算法中,需要遍历整个列表,将你遇到的第一个元素放在其正确的位置,然后移动到下一个元素,继续处理-,不管是什么元素,都将其插入到合适的位置。
So again, if you're at X and the winner is at Y, it hurts you minus the distance between X and Y, in terms of your unhappiness, about having a winner who's far away from you, winning.
再说一遍,如果你在X且获胜者在Y,它对你的伤害等于X和Y之间的距离,即,当选人和你之间的距离,这就是你在选举之后郁闷的程度
Well basically, all I'd have to do is go through and find every place I checked the constraint, and change it. To incorporate the new constraint.
比较简单,在最上方,基本上,我做的所有事情就是遍历,整段代码然后找到我对比。
So, the point is whenever you have derivatives with something over dt, do not hesitate to cancel the dts This will be actually true as long as both quantities are vanishingly small.
关键在于,只要你推出的式子分母上有dt,不要犹豫,直接约掉,这个式子只在,两遍都是无穷小的情况下成立
应用推荐