What sort algorithm provides the best worst-case performance?

后端 未结 16 2104
[愿得一人]
[愿得一人] 2020-12-15 14:44

What is the fastest known sort algorithm for absolute worst case? I don\'t care about best case and am assuming a gigantic data set if that even matters.

16条回答
  •  旧巷少年郎
    2020-12-15 14:58

    I've always preferred merge sort, as it's stable (meaning that if two elements are equal from a sorting perspective, then their relative order is explicitly preserved), but quicksort is good as well.

提交回复
热议问题