From my understanding, R's order()
method uses radix sort by default. This was not always the case (see news), but Matt Dowle made this presentation suggesting change because radix sort empirically performs well.
My question is, why is radix sort better than other sorting algorithms in practice? Wikipedia doesn't make a strong case for radix sort. Also, why do other popular languages/tools like Python and pandas not use radix sort by default, if it is truly the best sorting algorithm?
As you know, there is not any best sorting algorithm in general case. A solution can be Radix sort is a stable sort. Hence, as in R keeping the order of tie cases could be important, they implemented a stable sort method.
You can find more about the stability here and also in this post.
Another point is, as stability can be important in different situations, you should find the best between stable sort algorithms which come here.
B
C
G
I
L
M
O
P
R
T
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With