Loading...

Galloping in fast-growth natural merge sorts

Ghasemi, E ; Sharif University of Technology | 2022

66 Viewed
  1. Type of Document: Article
  2. DOI: 10.4230/LIPIcs.ICALP.2022.68
  3. Publisher: Schloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing , 2022
  4. Abstract:
  5. We study the impact of sub-array merging routines on merge-based sorting algorithms. More precisely, we focus on the galloping sub-routine that TimSort uses to merge monotonic (non-decreasing) sub-arrays, hereafter called runs, and on the impact on the number of element comparisons performed if one uses this sub-routine instead of a naive merging routine. The efficiency of TimSort and of similar sorting algorithms has often been explained by using the notion of runs and the associated run-length entropy. Here, we focus on the related notion of dual runs, which was introduced in the 1990s, and the associated dual run-length entropy. We prove, for this complexity measure, results that are similar to those already known when considering standard run-induced measures: in particular, TimSort requires only O(n + n log(σ)) element comparisons to sort arrays of length n with σ distinct values. In order to do so, we introduce new notions of fast- and middle-growth for natural merge sorts (i.e., algorithms based on merging runs). By using these notions, we prove that several merge sorting algorithms, provided that they use TimSort's galloping sub-routine for merging runs, are as efficient as TimSort at sorting arrays with low run-induced or dual-run-induced complexities. © Elahe Ghasemi, Vincent Jugé, and Ghazal Khalighinejad; licensed under Creative Commons License CC-BY 4.0
  6. Keywords:
  7. Analysis of algorithms ; Merge sorting algorithms ; Sorting algorithms ; Entropy ; Mergers and acquisitions ; Complexity measures ; Element comparison ; Fast growths ; Merge sorting algorithm ; Monotonics ; Run length ; Sorting algorithm ; Subarray ; Merging
  8. Source: 49th EATCS International Conference on Automata, Languages, and Programming, ICALP 2022, 4 July 2022 through 8 July 2022 ; Volume 229 , 2022 ; 18688969 (ISSN); 9783959772358 (ISBN)
  9. URL: https://drops.dagstuhl.de/opus/volltexte/2022/16409/pdf/LIPIcs-ICALP-2022-68.pdf