Everything About ___
Live briefing

Everything about Library sort

Sorting algorithm

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. The name comes from an analogy:Suppose a librarian were to store their books alphabetically on a long shelf, starting with the As at the left end, and continuing to the right along the shelf with no spaces between the books until the end of the Zs. If the librarian acquired a new book that belongs to the B section, once they find the correct space in the B section, they will have to move every book over, from the middle of the Bs all the way down to the Zs in order to make room for the new book. This is an insertion sort. However, if they were to leave a space after every letter, as long as there was still space after B, they would only have to move a few books to make room for the new one. This is the basic principle of the Library Sort. Wikipedia →

🧭 Start here: a 6-step reading path

  1. Read the overview: Library sortA 5-minute orientation
  2. Pick up a classic book: The Titan's CurseThe most-reprinted book on the subject
  3. Read the landmark paper: The physical map of the whole E. coli chromosome: Application of a new strategy for rapid analysis and sorting of a large genomic libraryCited 1,394 times
  4. Go sideways: Insertion sortA closely related topic
  5. Go sideways: Sorting algorithmA closely related topic

📖 Definitions

Noun A form of insertion sort that leaves gaps between elements to accelerate subsequent insertions.

🗂️ The subject at a glance

  1. Implementation

🏆 Landmark papers (most cited)

📚 Books worth reading

Ranked by number of editions on Open Library, a rough measure of how lasting a book is.

🔗 Related topics