当前位置: X-MOL 学术Future Gener. Comput. Syst. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
A new approach to Mergesort algorithm: Divide smart and conquer
Future Generation Computer Systems ( IF 7.5 ) Pub Date : 2024-04-03 , DOI: 10.1016/j.future.2024.03.049
Sahin Emrah Amrahov , Yilmaz Ar , Bulent Tugrul , Bekir Emirhan Akay , Nermin Kartli

It is well known that comparison-based algorithms cannot run faster than . Therefore the running times of Mergesort, Heapsort, and Quicksort algorithms are asymptotically optimal. As well as asymptotic running times, how fast sorting algorithms work in practice has gained importance lately. One algorithm is preferred, if it is slightly more efficient than another, due to the rapid increase in data generation. In this study, we consider the Mergesort algorithm with a different approach. Unlike the Mergesort algorithm, we do not perform unconditional division. Instead, we divide the input array into ascending and descending sub-arrays. Then, we merge the sub-arrays obtained as a result of the division by slightly modifying the classical function. As a result of these two operations, we obtain three new sorting algorithms depending on how we get ascending and descending sub-arrays. Among these three algorithms, the third one, which is our main proposed algorithm, is more important both theoretically and practically. In this algorithm, we divide the input array into alternately ascending and descending sub-arrays. Moreover, the terms of the sub-arrays do not have to be consecutive terms of the input array. The asymptotic running time of our proposed algorithm is in the worst case and in the best case. In practice, the proposed algorithm performs better than the classical Mergesort algorithm in arrays with Gaussian and Uniform distributions of various sizes. In an array of four million, it provided a 17% improvement in the Gaussian distribution compared to the classical Mergesort algorithm. In addition, it provided a 29% improvement in the Uniform distribution of the same size. The proposed algorithm performs also much better than traditional sorting algorithms in real data collected from various sources.

中文翻译:

归并排序算法的新方法:智能划分并征服

众所周知,基于比较的算法不能比 .因此,归并排序、堆排序和快速排序算法的运行时间是渐近最优的。除了渐近运行时间之外,排序算法在实践中的运行速度最近也变得越来越重要。由于数据生成的快速增加,如果一种算法比另一种算法稍微高效,则该算法是首选。在本研究中,我们考虑采用不同方法的合并排序算法。与合并排序算法不同,我们不执行无条件除法。相反,我们将输入数组分为升序和降序子数组。然后,我们通过稍微修改经典函数来合并作为除法结果而获得的子数组。作为这两个操作的结果,我们获得了三种新的排序算法,具体取决于我们如何获得升序和降序子数组。在这三种算法中,第三种算法是我们主要提出的算法,无论在理论上还是在实践上都更为重要。在此算法中,我们将输入数组划分为交替升序和降序的子数组。此外,子数组的项不必是输入数组的连续项。我们提出的算法的渐近运行时间是在最坏情况和最好情况下的。实际上,在各种大小的高斯分布和均匀分布的数组中,所提出的算法比经典的归并排序算法表现得更好。在 400 万个数组中,与经典的归并排序算法相比,它在高斯分布方面提供了 17% 的改进。此外,它在相同大小的均匀分布方面提供了 29% 的改进。在从各种来源收集的实际数据中,所提出的算法的性能也比传统排序算法好得多。
更新日期:2024-04-03
down
wechat
bug