SRCS: A New Proposed Counting Sort Algorithm based on Square Root Method
Hridoy Roy, Md. Shafiuzzaman, Md. Samsuddoha · 2019
Counting sort is one of the basic sorting algorithm in computer science which has a time complexity of O(N + K) where N is the number of elements and K is the maximum value among those N elements. It is superior when it comes to sort countable objects those come from a discrete set of values, such as bounded integers. But, it fails to provide efficiency if the range of K is significantly greater than N. For this reason, it is less used in practical fields of computer science though it has an extensive use as a sub-routine in other sorting algorithms. Several extension approaches on counting sort algorithm have been proposed in the literature but none of those aims to increase the limit of K. This paper proposed an extension of counting sort algorithm that is named Square Root Counting Sort (SRCS) which has an increased limit of K. Specifically, the proposed approach can handle the maximum value of K2where the classic one is only able to solve K. The first phase of the approach is to prepare some blocks of elements using square root technique and then sort each of the blocks simultaneously to get final sorted array. The proposed extension of counting sort outperforms than classic counting sort as well as bubble, selection and insertion sort.