Home > database >  Sorting algorithm, the optimal problem
Sorting algorithm, the optimal problem

Time:10-18

5000 for sorting keywords, to select a minimum of 10, the following the fastest algorithm

Quick sort
Heap sort
Merge sort
Insertion sort


Why heap sort the fastest? For help!

CodePudding user response:

If the letter to sort, the time complexity of each algorithm are set, this can query,
But you this is to select the minimum 10, not all of them all, I feel are not suitable for, actually exchange method, run 10 times can out results,
Your request is not sorted, minimum 10 to be found,
  • Related