Modern comparison sorts like quicksort suffer from performance inconsistencies due to suboptimal pivot selection, leading to $(O(N^2))$ worst-case complexity, while in-place merge sort variants face challenges with data movement overhead. We introduce Wave Sort, a novel in-place sorting algorithm that addresses these limitations through a dynamic pivot selection strategy. Wave Sort iteratively expands a sorted region and selects pivots from this growing sorted portion to partition adjacent unsorted data. This approach ensures robust pivot selection irrespective of dataset size, guarantees a logarithmic recursion stack depth, and enables efficient in-place sorting. Our analysis shows a best comparison complexity of $(N-1)$, average comparison complexity close to $(\log_2(N)!)$, and worst-case comparison complexity bounded by $(O(N(\log(N))^2))$ with a small constant factor, which could be reduced to $(O(N\log(N)))$ with hybrid sorting. The algorithm can be easily expanded to be hybridized with other sorting algorithms. Experimental results demonstrate that Wave Sort requires significantly fewer comparisons than quicksort on average (approximately 24% less) and performs close to the theoretical minimum $(\log_2(N)!)$. Wave Sort offers a compelling alternative for applications demanding consistent, predictable, and in-place sorting performance.


翻译:现代比较排序算法(如快速排序)由于枢轴选择欠佳而存在性能不一致的问题,导致最坏情况复杂度为 $(O(N^2))$,而原地归并排序变体则面临数据移动开销的挑战。我们提出 Wave Sort,一种新颖的原位排序算法,通过动态枢轴选择策略解决了这些限制。Wave Sort 迭代地扩展已排序区域,并从这一不断增长的已排序部分中选择枢轴来划分相邻的未排序数据。这种方法确保了无论数据集大小如何都能进行稳健的枢轴选择,保证了递归栈深度的对数级,并实现了高效的原位排序。我们的分析表明,其最佳比较复杂度为 $(N-1)$,平均比较复杂度接近 $(\log_2(N)!)$,最坏情况比较复杂度受限于 $(O(N(\log(N))^2))$ 且常数因子较小,通过混合排序可进一步降低至 $(O(N\log(N)))$。该算法可以轻松扩展以与其他排序算法混合使用。实验结果表明,Wave Sort 平均所需的比较次数显著少于快速排序(约减少 24%),且性能接近理论最小值 $(\log_2(N)!)$。对于要求一致、可预测且原地排序性能的应用,Wave Sort 提供了一个引人注目的替代方案。

0
下载
关闭预览

相关内容

排序是计算机内经常进行的一种操作,其目的是将一组“无序”的记录序列调整为“有序”的记录序列。分内部排序和外部排序。若整个排序过程不需要访问外存便能完成,则称此类排序问题为内部排序。反之,若参加排序的记录数量很大,整个序列的排序过程不可能在内存中完成,则称此类排序问题为外部排序。内部排序的过程是一个逐步扩大记录的有序序列长度的过程。
【博士论文】电商搜索中的排序学习
专知会员服务
13+阅读 · 2025年11月15日
【博士论文】基于冲量的加速优化算法
专知会员服务
28+阅读 · 2021年11月29日
2018年深度学习优化算法最新综述
计算机视觉战队
10+阅读 · 2018年12月11日
简述多种降维算法
算法与数学之美
11+阅读 · 2018年9月23日
最新|深度离散哈希算法,可用于图像检索!
全球人工智能
14+阅读 · 2017年12月15日
详述DeepMind wavenet原理及其TensorFlow实现
深度学习每日摘要
12+阅读 · 2017年6月26日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员