English

Elementary Yet Precise Worst-case Analysis of MergeSort, A short version (SV)

Data Structures and Algorithms 2017-03-01 v1 Computational Complexity Discrete Mathematics

Abstract

This paper offers two elementary yet precise derivations of an exact formula W(n)=i=1nlgi=nlgn2lgn+1 W(n) = \sum_{i=1} ^{n} \lceil \lg i \rceil = n \lceil \lg n \rceil - 2^{\lceil \lg n \rceil} + 1 for the maximum number W(n) W(n) of comparisons of keys performed by MergeSort {\tt MergeSort} on an n n -element array. The first of the two, due to its structural regularity, is well worth carefully studying in its own right. Close smooth bounds on W(n) W(n) are derived. It seems interesting that W(n) W(n) is linear between the points n=2lgn n = 2^{\lfloor \lg n \rfloor} and it linearly interpolates its own lower bound nlgnn+1 n \lg n - n + 1 between these points.

Cite

@article{arxiv.1702.08443,
  title  = {Elementary Yet Precise Worst-case Analysis of MergeSort, A short version (SV)},
  author = {Marek A. Suchenek},
  journal= {arXiv preprint arXiv:1702.08443},
  year   = {2017}
}

Comments

25 pages, 12 figures, three of which contain working Java methods

R2 v1 2026-06-22T18:29:49.442Z