简体   繁体   English

合并整数排序数组

[英]Merge Sort Array of Integers

Can anyone help me with this pratice question: 33 31 11 47 2 20 24 12 2 43. I am trying to figure out what the contents of the two output lists would be after the first pass of the Merge Sort. 有人可以帮我解决这个务实的问题:33 31 11 11 47 2 20 24 12 2 43.我试图弄清楚在第一次通过合并排序之后,两个输出列表的内容是什么。

The answer is supposedly: List 1: 33 11 47 12 List 2: 31 2 20 24 2 43 答案可能是:清单1:33 11 47 12清单2:31 2 20 24 2 43

Not making any sense to me sense I was under the impression that the first pass was where it divided it into two lists at the middle.... 对我来说没有任何意义,我给人的印象是第一遍就是将其分为中间的两个列表。

33 31 11 47 2 20 24 12 At first the list divides into individual elements such that when a single ton list is formed each element is compared with the one next to it. 33 31 11 47 2 20 20 24 12首先,该列表分为多个单独的元素,以便在形成一个吨列表时,将每个元素与其旁边的元素进行比较。 So after first pass we have 所以经过第一遍之后

31 33 11 47 2 20 12 24 31 33 11 47 2 20 12 24
After that 之后

11 31 33 47 2 12 20 24 11 31 33 47 2 12 20 24
and then 接着

2 11 12 20 24 3133 37 2 11 12 20 24 3133 37

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM