200分翻译167个单词。归并排序算法说明。 ( 积分: 200 )

晨晨

Unregistered / Unconfirmed
GUEST, unregistred user!
内容如下:
Mergesort
Two sublists, each already sorted, can be merged together to form one aggregate list that is also sorted. A simple and effective procedure fordo
ing this, called mergesort, begin
s by comparing pairs of elements – one from each sublist. The smallest element appended to a forted list and is replaced by the next element from its sublist. This continues until there are no more elements in one of the sublists. The remaining elements in the other sublist are then
appended to the sorted list, and the sort is complete.
This sounds good where there are two sorted sublists with which to begin
. If there are not, the problem is to decide how to get started. There are several possibilities.
One approach is to consider individual elements as sorted sublists of length one. Pairs of these sublists are merged to produce sorted lists of length two. Pairs of these lists are merged to produce sorted lists of length four. This process continues until only one sorted list remains.
 

暗夜中独舞

Unregistered / Unconfirmed
GUEST, unregistred user!
非常复杂 唉~~
 
W

wxfdage

Unregistered / Unconfirmed
GUEST, unregistred user!
翻译完了,没提交上去,白费劲了
 
W

wxfdage

Unregistered / Unconfirmed
GUEST, unregistred user!
归并排序
把两个已经排好序的子列表合并成一个排好序个长列表。一种简单而有效的方法是归并排序,开始于从两个子列表中分别取出一个元素成对比较。
 
W

wxfdage

Unregistered / Unconfirmed
GUEST, unregistred user!
把两个中最小的元素添加到一个长列表的最后,并从它所在的子列表中取出下一个替换它。持续这个过程直到其中一个子列表为空。把另一个子列表中剩余的元素添加到长列表最后,排序就完成了。
 
W

wxfdage

Unregistered / Unconfirmed
GUEST, unregistred user!
如果开始就有两个已经排好序的子列表,这听起来是个不错的方法。否则,问题就在于要决定排序从何开始。
有几种可能。
一种方法是认为每个元素就是一个长度为1的排好序的子列表。两个这样的子列表归并成长度为2的有序子列表。两个这样的子列表归并成长度为4的有序子列表。持续这个过程直到只剩一个列表。
 
Z

zhaokaien

Unregistered / Unconfirmed
GUEST, unregistred user!
Mergesort
归并排序
Two sublists, each already sorted, can be merged together to form one aggregate
两个已经有序的子序列,能够合并成一个有序的序列,
list that is also sorted.
A simple and effective procedure fordo
ing this, called mergesort,
一个简单有效的完成上述行为的方法是使用归并排序,
begin
s by
comparing pairs of elements – one from each sublist.
这个方法是先从每一个自序列各取出一个元素进行比较,
The smallest element appended to a forted list and is replaced by the next element from its sublist.
将小的元素放到一条堡垒链表上,其后的元素再分别从子链表取得
This continues until there are no more elements in one of the sublists.
重复上面的比较的过程知道两条子链表之一中没有元素为止,
The remaining elements in the other sublist are then
appended to the sorted list,
另一条上还剩下的元素直接连接到已经有序的堡垒链表上
and the sort is complete.
排序完成
This sounds good where there are two sorted sublists with which to begin
.
这种方法看起来很好在于有两条已经有序的子链表
If there are not, the problem is to decide how to get started.
如果没有,问题是要决定如何开始
There are several possibilities.
这又几种可能
One approach is to consider individual elements as sorted sublists of length one.
一种方法是考虑单个元素作为长度为1的子链表
Pairs of these sublists are merged to produce sorted lists of length two.
两个这样的子链表合并成一个长度为2的链表
Pairs of these lists are merged to produce sorted lists of length four.
两个长度为2的则合并成长度为4的链表
This process continues until only one sorted list remains
这个过程继续知道只有一个链表存在为止
 
Z

zhaokaien

Unregistered / Unconfirmed
GUEST, unregistred user!
这最后的意思其实就是对于一个单个的链表要对他使用归并排序,就可先把他中的两个单个的元素看成是两个长度为1的子链表,对他们排序,然后依次再扩大,即可达成目标!!
 

晨晨

Unregistered / Unconfirmed
GUEST, unregistred user!
非常感谢!
 
顶部