When should we use Radix sort?

前端 未结 11 1844
孤街浪徒
孤街浪徒 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 17:05

    Here's a link which compares quicksort and radixsort:

    Is radix sort faster than quicksort for integer arrays? (yes it is, 2-3x)

    Here's another link which analyzes running times of several algorithms:

    A Question of Sorts:

    Which is faster on the same data; an O(n) sort or an O(nLog(n)) sort?

    Answer: It depends. It depends on the amount of data being sorted. It depends on the hardware its being run on, and it depends on the implementation of the algorithms.

提交回复
热议问题