Developing a Negative Fractional Counting Sort Algorithm for Fast Real Number Sorting
Developing a Negative Fractional Counting Sort Algorithm for Fast Real Number Sorting
Dip Sarker, American International University-Bangladesh (AIUB), email: 22-49304-3@student.aiub.edu
Dipta Gomes, American International University-Bangladesh (AIUB), email: diptagomes@aiub.edu
Tonmoy Dey, American International University-Bangladesh (AIUB)
Md. Manzurul Hasan, American International University-Bangladesh (AIUB), email: manzurul@aiub.edu
Dip Nandi, American International University-Bangladesh (AIUB), email: dip.nandi@aiub.edu
Sorting algorithms play a vital role in numerous computational processes, and the need for efficient sorting methods is expanding daily, particularly for real numbers. In this study, we extend prior work by proposing a novel sorting algorithm capable of handling mixed numeric arrays containing negative, positive, and fractional values. Our approach improves performance by using counting sort with scaling and offset techniques to reduce memory utilization and computational overhead, while maintaining linear complexity of O(n+range×precision). This modification addresses limitations of traditional counting sort when dealing with large ranges and real-number precision. We empirically show that the proposed method outperforms conventional algorithms in large datasets with moderate precision and range, providing reduced running time and better scalability. However, the algorithm is less effective for small datasets or cases requiring very high precision. The results indicate that this enhanced counting sort offers a competitive and practical solution for tasks where real numbers must be sorted quickly, such as data processing and machine learning preprocessing.
AIUB Journal of Science and Engineering
Link