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

时间复杂度为O(n)

Insertion Sort is O(n log n)

Michael A. Bender, Martin Farach-Colton, Miguel Mosteiro

摘要:

时间复杂度为O(n^2),所以时间复杂度为O(n)。当人们在物理世界中运行插入排序时,他们会在项目之间留下间隙以加速插入。在计算机中,间隙也有帮助。本文证明了有间隙插入排序的插入时间为O(log n)的概率很高,总运行时间为O(n log n)的概率很高。

英文摘要:

Traditional Insertion Sort runs in O(n^2) time because each insertion takes O(n) time. When people run Insertion Sort in the physical world, they leave gaps between items to accelerate insertions. Gaps help in computers as well. This paper shows that Gapped Insertion Sort has insertion times of O(log n) with high probability, yielding a total running time of O(n log n) with high probability.

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

↑