中文

Insertion Sort is O(n log n)

数据结构与算法 2007-05-23 v1

摘要

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.

关键词

引用

@article{arxiv.cs/0407003,
  title  = {Insertion Sort is O(n log n)},
  author = {Michael A. Bender and Martin Farach-Colton and Miguel Mosteiro},
  journal= {arXiv preprint arXiv:cs/0407003},
  year   = {2007}
}

备注

6 pages, Latex. In Proceedings of the Third International Conference on Fun With Algorithms, FUN 2004