Improving multikey Quicksort for sorting strings with many equal elements

  • Authors:
  • Eunsang Kim;Kunsoo Park

  • Affiliations:
  • School of Computer Science and Engineering, Seoul National University, 599 Gwanak-ro, Gwanak-gu, Seoul, 151-742, South Korea;School of Computer Science and Engineering, Seoul National University, 599 Gwanak-ro, Gwanak-gu, Seoul, 151-742, South Korea

  • Venue:
  • Information Processing Letters
  • Year:
  • 2009

Quantified Score

Hi-index 0.89

Visualization

Abstract

Bentley and Sedgewick proposed multikey Quicksort with 'split-end' partitioning for sorting strings. But it can be slow in case of many equal elements because it adopted 'split-end' partitioning that moves equal elements to the ends and swaps back to the middle. We present 'collect-center' partitioning to improve multikey Quicksort in that case. It moves equal elements to the middle directly like the 'Dutch National Flag Problem' partitioning approach and it uses two inner loops like Bentley and McIlroy's. In case of many equal elements such as DNA sequences, HTML files, and English texts, multikey Quicksort with 'collect-center' partitioning is faster than multikey Quicksort with 'split-end' partitioning.