Advanced Programming I Lecture Notes

Advanced Programming I Lecture Notes

2 February 2006 • Faster Sorting


Radix exchange sort can't treat s as a parameter because it depends on partitioning to sort the keys itself without using recursion. Each recursive call in radix exchange sort changes the digit being sorted; partitioning only gets one pass over a particular digit in the key, and it must sort in that pass.

The only way partitioning can be a sort is if it deals with at most two values. Partitioning moves all the smaller values before the larger values with respect to the digit being sorted. Only the radix-2 number system has two digit values, and s is fixed to be the number of binary digits in the keys.


This page last modified on 24 January 2006.