1. Work out an algorithm that uses a radix sort to sort strings of characters.
In 1959, the American computer scientist Donald Shell invented a technique that can be used to speed up many different sorting algorithms. For this project, you will apply Shell’s algorithms method to insertionsort. The basis of the technique is to get the items to move in big steps (rather than shifting elements to the next-higher index). These big-step shifts are done early in the algorithm, and they tend to put the array in nearly sorted order. Later in the algorithm, we use smaller steps (all the way down to steps of size 1, just like an ordinary insertionsort). But by the time that the small steps are being taken, the array is nearly sorted, and that’s a situation where insertionsort is efficient.
The choice of the step sizes affects the performance of the algorithm, but one sequence that is empirically good starts atn/2, and each subsequent step size is about the previous size divided by 2.2.
The overall pseudocode is given here:
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here