New simple and fast quicksort algorithm for equal keys
Parviz Afereidoon
TL;DR
The paper tackles sorting data with duplicates using quicksort and introduces eqsort, a simple equal-keys partitioning approach with variants that tightly couple partitioning and recursive sorting. By grouping keys equal to the pivot and providing concise implementations (eqsort1/eqsort2/eqsort3), the method achieves strong performance compared with fat partitioning, dual-pivot quicksort, and pdqsort across diverse duplication levels. Experimental results show eqsort is consistently competitive, often faster, and provides favorable comparisons-swaps trade-offs, especially on real-world data. This work suggests eqsort could replace or augment existing partitioning strategies in practical sorting libraries for datasets with many duplicates.
Abstract
This paper introduces a novel and efficient partitioning technique for quicksort, specifically designed for real-world data with duplicate elements (50-year-old problem). The method is referred to as "equal quicksort" or "eqsort". Based on the experimental findings, it has been determined that the newly developed algorithm, eqsort, is competitive with the best current implementations,such as fat partitioning algorithms and dual-pivot quicksort. This method offers several advantages over the commonly used dual-pivot method and pdqsort partitioning, making it a potential replacement.
