arXiv · cs/0407003
Insertion Sort is O(n log n)
Abstract
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.
Explore related subjects
Keep this discovery
Michael A. Bender, Martin Farach-Colton, Miguel Mosteiro. 2004-07-01. Insertion Sort is O(n log n). https://arxiv.org/abs/cs/0407003
Cite the original work for its findings. Save a collection to share your selection of sources.