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

Best-case Analysis of MergeSort with an Application to the Sum of Digits Problem, A manuscript (MS) v2 (1607.04604v2)

Published 15 Jul 2016 in cs.DM, cs.CC, and cs.DS

Abstract: An exact formula [ B(n) = \frac{n}{2}(\lfloor \lg n \rfloor + 1) - \sum _{k=0} {\lfloor \lg n \rfloor} 2k Zigzag(\frac{n}{2{k+1}}), ] where [ Zigzag (x) = \min (x - \lfloor x \rfloor, \lceil x \rceil - x), ] for the minimal number $ B(n) $ of comparisons of keys performed by $ {\tt MergeSort} $ on an $ n $-element array is derived and analyzed. The said formula is less complex than any other known formula for the same and can be evaluated in $ O(\log {c}) $ time, where $ c $ is a constant. It is shown that there is no closed-form formula for the above. Since the recurrence relation for the minimal number of comparisons of keys for $ {\tt MergeSort} $ is identical with a recurrence relation for the number of 1s in binary expansions of all integers between $ 0 $ and $ n $ (exclusively), the above results extend to the sum of binary digits problem.

Citations (1)

Summary

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