Computing Atlas

How Computing Was Built
Sign In
Text size
100%
Theme
Algorithm

Library Sort

Sorting Algorithm

Library sort, also called gapped insertion sort, is a sorting algorithm that uses an insertion sort but leaves gaps in the array to accelerate subsequent insertions, named by analogy to a librarian who leaves a space after every letter of the alphabet on a shelf so that a newly acquired book can be inserted without having to move every following book. The algorithm was proposed by Michael Bender, Martin Farach-Colton and Miguel Mosteiro in 2004 and published in 2006; like the insertion sort it is based on, it is a comparison sort, and it was shown to have a high probability of running in O(n log n) time, comparable to quicksort, rather than an ordinary insertion sort's O(n squared), though it requires extra space for its gaps and must randomly permute its input to guarantee that time bound.

Facts
Time Complexity
Time Complexity (category)
Linearithmic Time -- O(n log n) 1
Connections

Credited To

Source Library sort (Wikipedia)

In Field

Source Library sort (Wikipedia)

Invented By

Source Library sort (Wikipedia)

Uses Design Technique

Source Library sort (Wikipedia)
Sources
1. Library sort (Wikipedia)
Wikipedia article body, read for Browse By backfill (w-bbfill-computing6-0927)
Library sort (Wikipedia)
  • Credited To: Martin Farach-Colton, Lead section
    Martín Farach-Colton, and Miguel Mosteiro in 2004
  • Invented By: Martin Farach-Colton, Lead section
    Martín Farach-Colton, and Miguel Mosteiro in 2004
  • Uses Design Technique: Randomized Algorithms, Lead
    In order to warrant the high-probability time bounds, it must randomly permute the input, which changes the relative order of equal elements and shuffles any presorted input.
  • In Field: Algorithms and Complexity Theory, Lead sentence
    Library sort or gapped insertion sort is a sorting algorithm that uses an insertion sort, but with gaps in the array to accelerate subsequent insertions.
  • In Group: Comparison Sorting Algorithms, Lead
    Library sort or gapped insertion sort is a sorting algorithm that uses an insertion sort, but with gaps in the array to accelerate subsequent insertions.
View the Source
Comments (0)
No comments yet. Be the first to share a thought.
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.