Note: Moves and displacements of particular elements in Quicksort

  • Authors:
  • Conrado Martínez;Helmut Prodinger

  • Affiliations:
  • Department of Llenguatges i Sistemes Informàtics, Universitat Politècnica de Catalunya, E-08034 Barcelona, Spain;Department of Mathematics, University of Stellenbosch, 7602 Stellenbosch, South Africa

  • Venue:
  • Theoretical Computer Science
  • Year:
  • 2009

Quantified Score

Hi-index 5.23

Visualization

Abstract

In this research note we investigate the number of moves and the displacement of particular elements during the execution of the well-known quicksort algorithm. This type of analysis is useful if the costs of data moves were dependent on the source and target locations, and possibly the moved element itself. From the mathematical point of view, the analysis of these quantities turns out to be related to the analysis of quickselect, a selection algorithm which is a variant of quicksort that finds the i-th smallest element of n given elements, without sorting them. Our results constitute thus a novel application of M. Kuba's machinery [M. Kuba, On quickselect, partial sorting and multiple quickselect, Inform. Process. Lett. 99(5) (2006) 181-186] for the solution of general quickselect recurrences.