A framework for adaptive sorting

https://doi.org/10.1016/0166-218X(93)E0160-ZGet rights and content
Under an Elsevier user license
open archive

Abstract

A sorting algorithm is adaptive if it sorts sequences that are close to sorted faster than random sequences, where the distance is determined by some measure of presortedness. Over the years several measures of presortedness have been proposed in the literature, but it has been far from clear how they relate to each other. We show that there exists a natural partial order on the set of measures, which makes it possible to say that some measures are superior to others. We insert all known measures of presortedness into the partial order, and thereby provide a powerful tool for evaluating both measures and adaptive sorting algorithms. We further present a new measure and show that it is a maximal element in the partial order formed by all known measures, and thus that any sorting algorithm that optimally adapts to the new measure also optimally adapts to all other known measures of presortedness. We have not succeeded in developing an optimal algorithm for the new measure; however, we present one that is optimal in terms of comparisons.

Keywords

Sorting
Presortedness
Measures
Partial order

Cited by (0)

A preliminary version of this paper was presented at the Third Scandinavian Workshop on Algorithm Theory, Helsinki, Finland, July 1992.