A General Method for Improving Insertion-Based Adaptive Sorting

  • Riku Saikkonen
  • Eljas Soisalon-Soininen
Conference paper

DOI: 10.1007/978-3-642-35261-4_25

Part of the Lecture Notes in Computer Science book series (LNCS, volume 7676)
Cite this paper as:
Saikkonen R., Soisalon-Soininen E. (2012) A General Method for Improving Insertion-Based Adaptive Sorting. In: Chao KM., Hsu T., Lee DT. (eds) Algorithms and Computation. ISAAC 2012. Lecture Notes in Computer Science, vol 7676. Springer, Berlin, Heidelberg

Abstract

A presortedness measure describes to which extent a sequence of key values to be sorted is already partially sorted. We introduce a new natural measure of presortedness, which is a composition of two existing ones: Block that gives the number of already sorted disjoint subsequences of the input, and Loc defined as \(\prod^{n}_{i=2} d_i\), where di denotes the distance between the (i − 1)th and the ith element of the input in the ordered sequence up to the ith element. We also give a general method for improving insertion-based adaptive sorting, applying it to Splaysort to produce an algorithm that is optimal with respect to the new composite measure. Our experiments are performed for splay-tree sorting which has been reported to be among the most efficient adaptive sorting algorithms. Our experimental results show that, in addition to the theoretical superiority, our method improves standard Splaysort by a large factor when the input contains blocks of reasonable size.

Keywords

Adaptive sorting Measures of presortedness Search trees 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Riku Saikkonen
    • 1
  • Eljas Soisalon-Soininen
    • 1
  1. 1.School of Science and Technology, Department of Computer Science and EngineeringAalto UniversityAaltoFinland

Personalised recommendations