Count Sort

Let’s look at the count sort algorithm.

Introduction

The count sort is a basic and efficient method of sorting if we’re given a range. For example, we want to sort the number of persons in each age category. Let’s suppose people’s ages can range from 0 to 130. Therefore, we can directly store counts in an array of size 130.

We can use the count sort in O(n+k)O(n+k) ...