Math 2.0

Computer science Algorithms as mathematical objects Concept

Insertion sort

Summary

Insertion sort is a simple sorting algorithm that builds the sorted list one element at a time. It inserts each new element into its place among the elements already sorted. It uses Θ(n2)\Theta(n^2) comparisons in the worst case but only n−1n - 1 on a sorted list. So it is fast on short or nearly sorted lists. It is stable and needs only a constant amount of extra memory. Mathlib formalizes it as List.insertionSort.

Further reading

  1. Web https://en.wikipedia.org/wiki/Insertion_sort
About this page
TagXA3JEEDC59
URIm2://XA3JEEDC59
Kindconcept
WritingW0 stub
MSC68P10, 68W40
SpecializesSorting algorithm
Same as
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

Definitions