Why quicksort is more popular than radix-sort?

前端 未结 6 2353
青春惊慌失措
青春惊慌失措 2020-12-01 15:29

Why quicksort(or introsort), or any comparison-based sorting algorithm is more common than radix-sort? Especially for sorting numbers.

Radix-sort is not comparison b

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-01 16:01

    One obvious answer is that you can sort arbitrary types using quicksort (ie anything that's comparable), while you are restricted to numbers only with radix. And IMO quicksort is a lot more intuitive.

提交回复
热议问题