arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1508.00292cs.DS
收藏

一种可证明的线性时间原地稳定的完全洗牌合并算法

A Provably, Linear Time, In-place and Stable Merge Algorithm via the Perfect Shuffle

John Ellis, Ulrike Stege

摘要:

我们重新考虑最近发表的算法(Dalkilic等人)。用于通过完美洗牌的方式合并列表。最初的出版物只给出了实验结果,虽然与测试样本的线性执行时间一致,但没有提供分析。在这里,我们证明了时间复杂度,在平均情况下,确实是线性的,虽然有一个欧米茄(n^2)的最坏情况。这是第一个可证明的线性时间合并算法的基础上使用的完美洗牌。我们提供了一个证明的正确性,扩展算法的一般情况下,列表的长度是不相等的,并显示它如何可以稳定,所有方面不包括在原来的演示文稿,我们给出了一个更简洁的算法定义。

英文摘要:

We reconsider a recently published algorithm (Dalkilic et al.) for merging lists by way of the perfect shuffle. The original publication gave only experimental results which, although consistent with linear execution time on the samples tested, provided no analysis. Here we prove that the time complexity, in the average case, is indeed linear, although there is an Omega(n^2) worst case. This is then the first provably linear time merge algorithm based on the use of the perfect shuffle. We provide a proof of correctness, extend the algorithm to the general case where the lists are of unequal length and show how it can be made stable, all aspects not included in the original presentation and we give a much more concise definition of the algorithm.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑