Let's do selection and let's do merge sort here on the right just to see what actually happens.
中间进行选择排序,右边进行归并排序,看看会发生什么。
It's not your horizon; it's not my horizon; it's that effective history which takes place when our horizons merge.
这不是你的视域,也不是我的视域;,而是我们的视域融合时产生的有效历史。
At that stage we can merge these, and then take this down, do the division merge and bring them back up.
在那里做一次分解,做到这步时,我们可以把这些进行合并,然后把这个拿下来,做分解合并过程后再把它们拿回去。
I'm gonna tell you go sort the left, go sort the right, and then I'll merge the two together.
那先对左半部分排序,再对右半部分排序,然后将两者合并起来。
What this did is it allowed banks to offer insurance or to ally and join in and merge with insurance companies.
这个法案允许了银行从事保险业务,或者与保险公司合作,整合,并购
But this is a type with which Sal longs to merge.
但这是萨尔渴望融合进去的一类美国人。
Yeats was trained in the occult disciplines of Theosophy and Gnosticism. Those traditions merge in his early work with European symbolism, and also with Irish cultural nationalism.
叶芝曾受到通神论和诺斯替教,神秘主义教条的训练,这些传统,在他早期作品中与欧洲象征主义,和爱尔兰文化民族主义结合。
In other words, it is to bring the rigor, the substance, the empirical foundation, the science from academia and merge it with accessibility of the self-help or New Age movement.
换句话说,就是要把严谨,实质,经验基础,学术科学,与自助或新纪元运动的通俗易懂相结合。
- >> I'll keep asking until we get the right -- until we all merge on the same one.
>,我将一直问,直到我们得到了正确的答案-,直到我们都得到同一个答案。
When these two merges are done, we're basically at a stage in that branch where we can now merge those two together, which gives us that, and it goes through the rest of it.
拿到从那边得到的第二个子列表,这是一个基本情况,合并它,当这两个合并完成后,我们基本到了该分支阶段,这里我们可以把两个合并在一起。
Run merge sort on those. By induction, if it does the right thing, I'm going to get back two lists, and I'm going to then merge Them together. Notice what I'm going to do.
在这些上面再运行归并排序,根据归纳,如果这样是正确的,我将重新得到两个列表,然后我会把它们合并在一起。
So let me give you an example. Suppose I want to merge two lists, and they're sorted.
我想合并两个列表,并且这两个列表已经排好序了。
We said each of the merge operations O was of order n. But n is different. Right?
注意这里发生了什么,我们说过每一次合并操作的复杂度都是?
What they usually do is they take the underperforming fund and they merge it with one that has a better track record.
更常见的做法是把运作不佳的基金,合并到另一只表现良好的基金中去
So at the moment left hand is at the start of this list of size 1, my right hand is at the start of this list of size 1, and now I need to merge these two lists.
现在左手手指指向这个大小为1的列表的开始,右手手指指向这个大小为1的列表的开始,现在我需要合并这两个列表。
OK, what I would like you to see is I've been printing out, as I went along, actually let's back up slightly and look at the code. There's merge sort.
好的,我想让你们看就是我运行过后,打印出来的结果,我们再回头看一下这段代码,这就是归并排序,输入一个列表。
Well, we saw the teaser in terms of that animation that suggests this merge sort algorithm when implemented by a computer is absolutely faster.
我们从前面的动画中可以看到,这个归并排序算法在计算机上实现之后,绝对比其他算法更快。
Merge. Now this is pretty easy, this one, but let's use the same heuristics.
合并,现在这个非常简单,但我们用同样的试探法。
They want to merge the Securities and Exchange Commission and the Commodity Futures Trading Commission.
他们还想要合并证券交易委员会,和期货商品交易委员会。
So in other words, every time I merge the point that I kept emphasizing verbally there and that I'm only touching each number once, means that we have to account for the amount of time it takes to merge N which is going to be just N. Now, this is again one of these cyclical answers.
换言之,之前在做合并时,我不停地强调,对每个数字我只碰了一次,这就是说,我们要记录合并所花的时间量,也就是这里的,这又是一种循环性的答案。
I merge. And the merge is, put them in order.
合并的过程是将它们按顺序摆放。
And it's called divide and conquer for the obvious reason. I'm going to divide it up into sub-problems with the hope that those sub-problems get easier. It's going to be easier to conquer if you like, and then I'm going to merge them back. Now, in the binary search case, in some sense, this is a little bit trivial.
因此被称为分治的原因就这么简单,将一个问题分解成一些子问题,并希望这些子问题解决起来比较方便,正如你希望的,求解的过程也会变得简单,下面就是把结果合并起来,现在,在二分搜索的例子里,从某些方面来说,这有点微不足道。
Merge up here. There's a little more code there.
在这里进行合并,这里的代码有点多。
I hope you can see this because I'm going to try and simulate what a merge sort does. I've got eight things I want to sort here, and those initially start out here at top level.
我希望你们认真看,因为我要尝试着模拟出归并排序的操作过程,这里我有八个元素进行排序,第一步是将它们分成两半,对吗?
You have to touch each of the 16 elements once as I go across the blackboard to actually merge them together, alright.
为了将这16个元素,合并到一起,对每个元素都只会用到一次。
Merge sort takes this idea of divide and conquer, and it does the following: it says let's divide the list in half.
归并排序以如下的步骤使用了分治思想:,把列表分成两半:,下面就是分治。
Let's run merge sort on it, and then we'll look at the code.
让我们在这个列表上运行归并排序,然后我们在看一下代码。
How much work do I have to do to actually merge them together?
我需要耗费多大的工作量来他们进行合并?,让我来举个例子?
Wow I can sort two lists, so I can merge two lists.
喔,我可以,将两个列表排好序。
应用推荐