Implement counting sort.
Improve radix sort implementation by avoiding instantiating a new array every time.