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

**Authors:** Marek A. Suchenek

arXiv: 1702.08443 · 2017-03-01

## TL;DR

This paper presents two elementary and precise derivations of the exact maximum comparison count in MergeSort, providing clear formulas and bounds that enhance understanding of its worst-case performance.

## Contribution

It introduces two simple yet exact derivations of the worst-case comparison formula for MergeSort, along with smooth bounds and insights into its linear behavior between powers of two.

## Key findings

- Exact formula for W(n) involving ceiling of log n
- Smooth bounds on the maximum comparisons in MergeSort
- W(n) linearly interpolates between key points

## Abstract

This paper offers two elementary yet precise derivations of an exact formula   \[ 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) $ of comparisons of keys performed by $ {\tt MergeSort} $ on an $ 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) $ are derived. It seems interesting that $ W(n) $ is linear between the points $ n = 2^{\lfloor \lg n \rfloor} $ and it linearly interpolates its own lower bound $ n \lg n - n + 1 $ between these points.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1702.08443/full.md

## Figures

9 figures with captions in the complete paper: https://tomesphere.com/paper/1702.08443/full.md

## References

9 references — full list in the complete paper: https://tomesphere.com/paper/1702.08443/full.md

---
Source: https://tomesphere.com/paper/1702.08443