ExpoSort:突破不情愿排序的拟多项式时间壁垒
ExpoSort: Breaking the quasi-polynomial-time barrier for reluctant sorting
AI总结:
本文提出 ExpoSort 算法,以 Θ(2^n) 时间首次突破 SlowSort 的拟多项式下界,成为最慢排序的新标杆,同时揭示其微小改动即可变为实用的 InsertionSort 变体。
摘要:
我们提出了 ExpoSort 算法,这是一种开创性的方法,能够以极其低效的 Θ(2^n) 时间对包含 n 个数字的数组进行排序。ExpoSort 自豪地宣称自己是第一个果断超越 Broder 和 Stolfi [ACM SIGACT News, 1984] 所提出的臭名昭著的 SlowSort 算法的拟多项式运行时间 Ω(n^{log n/(2+ε)}) 的不情愿算法。在不断追求最慢排序的进程中,ExpoSort 重新定义了“慢慢来”的含义。值得注意的是,ExpoSort 以所有已知排序算法中最简单的伪代码之一实现了这一壮举。然而,一个微小的修改——仅仅将一个递归调用移入 if 语句内部——就能将 ExpoSort 转变为经典 InsertionSort 的一个伪装得惊人的变体,其最佳情况和最坏情况运行时间分别为 Θ(n) 和 Θ(n^3)。ExpoSort 的这种双重性质提醒我们,在构造 pessimal 算法时需要格外小心,因为判断上的微小失误可能导致意外产生一个令人尴尬地实用的算法。
英文摘要:
We introduce the algorithm ExpoSort, a groundbreaking method that sorts an array of $n$ numbers in a spectacularly inefficient $Θ(2^n)$ time. ExpoSort proudly claims the title of the first reluctant algorithm to decisively surpass the quasi-polynomial running time $Ω(n^{\log n/(2+\varepsilon)})$ of the notoriously sluggish SlowSort algorithm by Broder and Stolfi [ACM SIGACT News, 1984]. In the ongoing quest for the slowest possible sort, ExpoSort redefines what it means to take one's time. Remarkably, ExpoSort achieves this feat with one of the simplest pseudocodes among all known sorting algorithms. However, a slight modification -- merely moving one recursive call inside an if statement -- transforms ExpoSort into an astonishingly well-camouflaged variant of the classic InsertionSort with best- and worst-case running times of $Θ(n)$ and $Θ(n^3)$, respectively. This dual nature of ExpoSort serves as a reminder of the utmost care required when crafting pessimal algorithms, where a slight lapse in judgment could result in accidentally producing an embarrassingly practical algorithm.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。