Why quicksort is more popular than radix-sort?

Two arguments come to my mind:

  1. Quicksort/Introsort is more flexible: Quicksort and Introsort work well with all kinds of data. All you need for sorting is the possibility to compare items. This is trivial with numbers but you can sort other data as well. Radix sort on the other hand just sorts things by their binary representation. It never compares items against each other.
  2. Radix sort needs more memory. All radix sort implementations that I’ve seen use a secondary buffer to store partial sorting results. This increases the memory requirements of the sorting algorithm. That may not be a problem if you only sort a couple of kilobytes, but if you go into the gigabyte range it makes a huge difference. If I remember right a in place radix-sort algorithm exist on paper though.

Leave a Comment