Sorting number

From Wikipedia, the free encyclopedia

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.

The th sorting number is given by the formula[1]

The sequence of numbers given by this formula (starting with ) is

0, 1, 3, 5, 8, 11, 14, 17, 21, 25, 29, 33, 37, 41, ... (sequence A001855 in the OEIS).

The same sequence of numbers can also be obtained from the recurrence relation[2],

.

It is an example of a 2-regular sequence.[2]

Asymptotically, the value of the th sorting number fluctuates between approximately and depending on the ratio between and the nearest power of two.[1]

Application to sorting

Other applications

References

Related Articles

Wikiwand AI