The general schema is just an extension of the process illustrated in the previous problem. By increasing the radix appropriately we can always reduce the number of passes over the data to two. Knuth provides a nice chart showing the best radii for a variety of values. I would highly recommend that you examine Section5.2.5 of The Art of Computer Programming, Vol. 3 for more details.