Radix sorting algorithm implemented using 2 arrays in C++