Bulk-Insertion Sort: Towards Composite Measures of Presortedness

  • Authors:
  • Riku Saikkonen;Eljas Soisalon-Soininen

  • Affiliations:
  • Helsinki University of Technology, Finland;Helsinki University of Technology, Finland

  • Venue:
  • SEA '09 Proceedings of the 8th International Symposium on Experimental Algorithms
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

Well-known measures of presortedness, among others, are the number of inversions needed to sort the input sequence, or the minimal number of blocks of consecutive elements that remain as such in the sorted sequence. In this paper we study the problem of possible composition of measures. For example, after determining the blocks in an input sequence, it is meaningful to measure how many inversions of the blocks are needed to finally sort the sequence. With composite measures in mind we introduce the idea of applying bulk insertions to improve adaptive binary-tree (AVL) sorting; this is done by combining local insertion sort with bulk-insertion methods. We show that bulk-insertion sort is optimally adaptive with respect to the number of bulks and with respect to the number of inversions in the original input. As to composite measures, we define a new measure that tells how many inversions are needed when the extracted bulks form the input. Bulk-insertion sort is shown to be adaptive with respect to this measure. Our experiments show that applying bulk insertion in AVL-tree sorting considerably reduces the number of comparisons and time needed to sort nearly sorted sequences.