Merge Strategies: from Merge Sort to TimSort - Archive ouverte HAL Accéder directement au contenu
Pré-Publication, Document De Travail Année : 2015

Merge Strategies: from Merge Sort to TimSort

Résumé

The introduction of TimSort as the standard algorithm for sorting in Java and Python questions the generally accepted idea that merge algorithms are not competitive for sorting in practice. In an attempt to better understand TimSort algorithm, we define a framework to study the merging cost of sorting algorithms that relies on merges of monotonic subsequences of the input. We propose an optimal strategy for lists and a 2-approximation for arrays. We compare them to the merging strategy of TimSort by designing a simpler yet competitive algorithm based on the same ideas. As a side benefit, our framework allows to establish the announced running time of TimSort, that is O(n log n).
Fichier principal
Vignette du fichier
aunipi2016-merge-sorts.pdf (438.13 Ko) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)

Dates et versions

hal-01212839 , version 1 (07-10-2015)
hal-01212839 , version 2 (09-12-2015)

Identifiants

  • HAL Id : hal-01212839 , version 1

Citer

Nicolas Auger, Cyril Nicaud, Carine Pivoteau. Merge Strategies: from Merge Sort to TimSort. 2015. ⟨hal-01212839v1⟩
5210 Consultations
5416 Téléchargements

Partager

Gmail Facebook X LinkedIn More