Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
169 tokens/sec
GPT-4o
7 tokens/sec
Gemini 2.5 Pro Pro
45 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
38 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

A Complete Worst-Case Analysis of Heapsort with Experimental Verification of Its Results, A manuscript (MS) (1504.01459v1)

Published 7 Apr 2015 in cs.DS, cs.CC, and cs.DM

Abstract: A rigorous proof is presented that the number of comparisons of keys performed in the worst case by ${\tt Heapsort}$ on any array of size $N \geq 2$ is equal to: $ 2 (N-1)\, ( \, \lg \frac{N-1}{2} +\varepsilon \, ) - 2s_2(N) - e_2(N) + \min (\lfloor \lg (N-1) \rfloor, 2) + 6 + c, $ where $ \varepsilon $, given by: $\varepsilon = 1 + \lceil \lg \, (N-1) \rceil - \lg \, (N-1) - 2{\lceil \lg \, (N-1) \rceil - \lg \, (N-1)} ,$ is a function of $ N $ with the minimum value 0 and and the supremum value $\delta = 1 - \lg e + \lg \lg e \approx 0.0860713320559342$, $s_2(N)$ is the sum of all digits of the binary representation of $N$, $e_2(N)$ is the exponent of $2$ in the prime factorization of $N$, and $ c $ is a binary function on the set of integers defined by: $c = 1$, if $N \leq 2 {\lceil \lg N \rceil} - 4$, and $c = 0$, otherwise. An algorithm that generates worst-case input arrays of any size $ N \geq 2 $ for ${\tt Heapsort}$ is offered. The algorithm has been implemented in Java, runs in $O( N \log N )$ time, and allows for precise experimental verification of the above formula.

Summary

We haven't generated a summary for this paper yet.