encyclopegia.org

Sorting number

In mathematics and computer science, the sorting numbers are a sequence of numbers introduced in 1950 by Hugo Steinhaus for the analysis of comparison sort algorithms. These numbers give the worst-case number of comparisons used by both binary insertion sort and merge sort. However, there are other algorithms that use fewer comparisons.

In mathematics and computer science, the sorting numbers are a sequence of numbers introduced in 1950 by Hugo Steinhaus for the analysis of comparison sort algorithms. These numbers give the worst-case number of comparisons used by both binary insertion sort and merge sort. However, there are other algorithms that use fewer comparisons. ==Formula and examples== The n th sorting number is given by the formula The sequence of numbers given by this formula (starting with n = 1 ) is The same sequence of numbers can also be obtained from the recurrence relation , A(n) = A\bigl(\lfloor n/2\rfloor\bigr) + A\bigl(\lceil n/2\rceil\bigr) + n - 1 . It is an example of a 2-regular sequence. Asymptotically, the value of the n th sorting number fluctuates between approximately n\log_2 n - n and n\log_2 n - 0.915n, depending on the ratio between n and the nearest power of two. ==Application to sorting== In 1950, Hugo Steinhaus observed that these numbers count the number of comparisons used by binary insertion sort, and conjectured (incorrectly) that they give the minimum number of comparisons needed to sort n items using any comparison sort. The conjecture was disproved in 1959 by L. R. Ford Jr. and Selmer M. Johnson, who found a different sorting algorithm, the Ford–Johnson merge-insertion sort, using fewer comparisons. The same sequence of sorting numbers also gives the worst-case number of comparisons used by merge sort to sort n items. ==Other applications== The sorting numbers (shifted by one position) also give the sizes of the shortest possible superpatterns for the layered permutations. ==References==

References

No reference rows published for this article.

Cite this article

MLA

"Sorting number." encyclopegia.org, 2025, https://encyclopegia.org/wiki/sorting-number. Accessed 24 November 2026.

Chicago

"Sorting number." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/sorting-number.

APA

encyclopegia.org. (2025). Sorting number. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/sorting-number

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

natural number

stub · references available

International Standard Book Number

stub · references available

No Face, No Name, No Number

stub · references available

Grassmann number

stub · references available

Lehmer random number generator

stub · references available

Mobile Station Roaming Number

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1328064441 · 0.5 · snapshot enwiki-001328064441

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.