Using the data structures, create as class that performs a CountingSort algorithm.

The class you make should be a subclass of the class SortRoutine and be added into the SortDriver.

As explained, CountingSort builds a frequency table as part of its sorting logic. A frequency table counts up how many times a certain value occurred in the dataset being sorted. For example, consider the following list of numbers to be sorted: 1, 4, 7, 12, 15, 2, 2, 3, 7, 8, 12

A frequency table for this set of numbers would look like this: See image.

Once you have the frequencies, the sorted result is produced by outputting the correct number of values in order. In this case, that would be one 1, two 2s, one 3, one 4, two 7s, one 8, two 12s and one 15.

Here are the steps CountingSort needs to perform:

• find the largest and smallest value in the dataset. This range of values determines how large your frequency array needs to be.
• allocate a frequency array with the size of (largest-smallest + 1)
• for each element in the frequency array, calculate its frequency in the dataset
• starting with the smallest element, overwrite the dataset with the number of items shown in the frequency table