When should we use Radix sort?

前端 未结 11 1854
孤街浪徒
孤街浪徒 2021-01-30 16:27

It seems Radix sort has a very good average case performance, i.e. O(kN): http://en.wikipedia.org/wiki/Radix_sort

Yet it seems like most people are still using

11条回答
  •  长情又很酷
    2021-01-30 16:54

    The other answers here are horrible, they don't give examples of when radix sort is actually used.

    An example is when creating a "suffix array" using the skew DC3 algorithm (Kärkkäinen-Sanders-Burkhardt). The algorithm is only linear-time if the sorting algorithm is linear-time, and radix sort is necessary and useful here because the keys are short by construction (3-tuples of integers).

提交回复
热议问题