login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) is the maximum number of key comparisons required to perform an indirect sort of n records with distinct keys using a two-way merge (A. D. Woodall's mergesort).
2

%I #9 Jan 12 2022 14:33:50

%S 1,4,6,10,13,17,20,25,29,34,38,43,47,52

%N a(n) is the maximum number of key comparisons required to perform an indirect sort of n records with distinct keys using a two-way merge (A. D. Woodall's mergesort).

%C There are six places in the Algol 60 procedure mergesort where the keys are compared. The sequence shows the maxima of the counts of these comparisons, determined over all n! possible orders of the records.

%C a(16) >= 56.

%D D. E. Knuth, The Art of Computer Programming Second Edition. Vol. 3, Sorting and Searching. Chapter 5.2.4 Sorting by Merging, Pages 164-166. Addison-Wesley, Reading, MA, 1998.

%H A. D. Woodall, <a href="https://doi.org/10.1093/comjnl/13.1.110">An internal sorting procedure using a two-way merge</a>, Algorithm 45, The Computer Journal, Volume 13, Number 1, February 1970, Algorithms Supplement, pp. 110-111.

%Y A350568 provides the corresponding average numbers and a comparison table.

%Y Cf. A001768, A001855, A350569.

%K nonn,more

%O 2,2

%A _Hugo Pfoertner_, Jan 09 2022