分类 "游戏相关" 下的文章
>置顶<

给定N个项目的数组,Merge Sort将:
1.将每对单独的元素(默认情况下,已排序)合并为2个元素的排序数组(Merge each pair of individual element (which is by default, sorted) into sorted arrays of 2 elements,

2.将每对2个元素的排序数组合并为4个元素的排序数组, 重复这个过程...,(Merge each pair of sorted arrays of 2 elements into sorted arrays of 4 elements, Repeat the process...,

3.最后一步:合并2个N / 2个元素的排序数组(为了简化本讨论,我们假设N是偶数)来获得N个元素的完全排序数组。(Final step: Merge 2 sorted arrays of N/2 elements (for simplicity of this discussion, we assume that N is even) to obtain a fully sorted array of N elements.

This is just the general idea and we need a few more details before we can discuss the true form of Merge Sort.


阅读全文

Title - Artist
0:00