A Novel Counting Sort for Real Numberswith Linear Time Complexity
Sanjeev Kumar, Madhu Sharma Gaur, Krishan Kumar, Prem Sagar Sharma · 2022 International Conference on Computational Intelligence and Sustainable Engineering Solutions (CISES) · 2022
Counting sort is a method that counts the occurrence of numbers with different key values. It sorts the numbers according to their key values (smaller integer) and mapped sorted value as an index of the array. This sort mainly uses to sort the integer number in linear time. It requires total O (N+K) execution time to sort the array of N elements, where K is the biggest number in the array. This paper presents a novel approach of counting sort with linear time complexity which is capable of sorting the real numbers as well as integer numbers. In this we have considered the small precision after the decimal because the large precision takes extra memory space. The proposed algorithm works for real numbers without affecting the time complexity of existing/original counting sort.