AI 中文总结
介绍基于递归分布的NFS排序算法,通过划分区间、递归细化桶等操作,结合不同方法处理大小输入,保证O(n log n)运行时间和O(log n)辅助空间,实验表明其在多方面优于现有排序方法。
AI 中文摘要
我们提出了速度需求排序(NFS排序),一种为数值数组设计的基于递归分布的排序算法。该算法将元素划分为等宽值区间,递归细化密集桶,并在递归调用之间传播分析区间边界,避免重复扫描局部最小值和最大值。NFS排序将用于大型子数组的基于片段、缓存感知的散射过程与用于较小输入的低开销辅助数组方法相结合。小桶推迟到最终插入排序清理,当递归分区反复无法减小问题大小时激活基于比较的回退。此机制保证最坏情况运行时间为O(n log n),辅助空间使用为O(log n)。在合成输入和来自SOSD基准套件的真实世界数据集上的实验评估将NFS排序与平衡学习排序、IPS4o、Boost Spreadsort、PDQSort和std::sort进行了比较。结果表明,NFS排序在数据集大小和分布方面具有竞争力或优于现有最先进的排序方法,在较小输入上尤其优于学习基线,同时在较大规模上保持强大性能。总体而言,NFS排序结合了高效的递归分布、实用的内存管理和强大的最坏情况保证,用于高性能数值排序。
英文摘要
We present Need for Speed Sort (NFS Sort), a recursive distribution-based sorting algorithm designed for numeric arrays. The algorithm partitions elements into equal-width value intervals, recursively refines dense buckets, and propagates analytical interval bounds between recursive calls, avoiding repeated scans for local minima and maxima. NFS Sort combines a fragment-based, cache-conscious scatter procedure for large subarrays with a lower-overhead auxiliary-array approach for smaller inputs. Small buckets are deferred to a final insertion-sort cleanup, while a comparison-based fallback is activated when recursive partitioning repeatedly fails to reduce the problem size. This mechanism guarantees a worst-case running time of O(n log n) and auxiliary space usage of O(log n). Experimental evaluation on synthetic inputs and real-world datasets from the SOSD benchmark suite compares NFS Sort with Balanced Learned Sort, IPS4o, Boost Spreadsort, PDQSort, and std::sort. The results show that NFS Sort is competitive or better than established state-of-the-art sorting methods across dataset sizes and distributions, outperforming the learned baseline particularly on smaller inputs while retaining strong performance at larger scales. Overall, NFS Sort combines efficient recursive distribution, practical memory management, and robust worst-case guarantees for high-performance numeric sorting.