Triple State QuickSort, A replacement for the C/C++ library qsort
Ammar Muqaddas

TL;DR
This paper introduces Triple State QuickSort, an industrial-grade sorting algorithm that outperforms existing implementations in speed and efficiency, providing a practical replacement for C/C++'s qsort with significant runtime improvements.
Contribution
The paper presents a novel Triple State QuickSort algorithm that reduces comparisons and swaps, offering a faster and more efficient sorting method as a replacement for qsort.
Findings
At least 15.8% faster than the best of four existing Quicksort implementations.
32.7% faster than Yaroslavskiy's Dual Pivot Quicksort.
Reduces comparisons and swaps in most cases while maintaining good worst-case performance.
Abstract
An industrial grade Quicksort function along with its new algorithm is presented. Compared to 4 other well known implementations of Quicksort, the new algorithm reduces both the number of comparisons and swaps in most cases while staying close to the best of the 4 in worst cases. We trade space for performance, at the price of n/2 temporary extra spaces in the worst case. Run time tests reveal an overall improvement of at least 15.8% compared to the overall best of the other 4 functions. Furthermore, our function scores a 32.7% run time improvement against Yaroslavskiy's new Dual Pivot Quicksort. Our function is pointer based, which is meant as a replacement for the C/C++ library qsort(). But we also provide an array based function of the same algorithm for easy porting to different programming languages.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Algorithms and Data Compression · Numerical Methods and Algorithms
