What sort algorithm provides the best worst-case performance?

后端 未结 16 2089
[愿得一人]
[愿得一人] 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

    Quicksort is usually the fastest, but if you want good worst-case time, try Heapsort or Mergesort. These both have O(n log n) worst time performance.

提交回复
热议问题