Galloping in natural merge sorts

12/07/2020
by   Vincent Jugé, et al.
0

We study the algorithm TimSort and the sub-routine it uses to merge monotonic (non-decreasing) sub-arrays, hereafter called runs. More precisely, we look at the impact on the number of element comparisons performed of using this sub-routine instead of a naive routine. In this article, we introduce a new object for measuring the complexity of arrays. This notion dual to the notion of runs on which TimSort built its success so far, hence we call it dual runs. It induces complexity measures that are dual to those induced by runs. We prove, for this new complexity measure, results that are similar to those already known when considering standard run-induced measures. Although our new results do not lead to any improvement on the number of element moves performed, they may lead to dramatic improvements on the number of element comparisons performed by the algorithm. In order to do so, we introduce new notions of fast- and middle-growth for natural merge sorts, which allow deriving the same upper bounds. After using these notions successfully on TimSort, we prove that they can be applied to a wealth of variants of TimSort and other natural merge sorts.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
01/15/2018

Strategies for Stable Merge Sorting

We introduce new stable, natural merge sort algorithms, called 2-merge s...
research
01/30/2021

Fragile Complexity of Adaptive Algorithms

The fragile complexity of a comparison-based algorithm is f(n) if each i...
research
05/26/2020

On the improvement of the in-place merge algorithm parallelization

In this paper, we present several improvements in the parallelization of...
research
09/22/2018

Adaptive Shivers Sort: An Alternative Sorting Algorithm

We present a stable mergesort, called , that exploits the existence of m...
research
04/05/2023

List and Certificate Complexities in Replicable Learning

We investigate replicable learning algorithms. Ideally, we would like to...
research
02/19/2018

Verifying Semantic Conflict-Freedom in Three-Way Program Merges

Even though many programmers rely on 3-way merge tools to integrate chan...
research
09/11/2022

Cores of Games via Total Dual Integrality, with Applications to Perfect Graphs and Polymatroids

LP-duality theory has played a central role in the study of cores of gam...

Please sign up or login with your details

Forgot password? Click here to reset