Adaptive Sorting and the Information Theoretic Lower Bound

  • Authors:
  • Amr Elmasry;Michael L. Fredman

  • Affiliations:
  • -;-

  • Venue:
  • STACS '03 Proceedings of the 20th Annual Symposium on Theoretical Aspects of Computer Science
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

We derive a variation of insertion sort that is near optimal with respect to the number of inversions present in the input. The number of comparisons performed by our algorithms, on an input sequence of length n that has I inversions, is at most n log2 (I/n + 1) + O(n). Moreover, we give an implementation of the algorithm that runs in time O(nlog2 (I/n + 1) + n). All previously known algorithms require at least cn log2(I/n + 1) comparisons for some c 1.