If you mean the criteria for choosing the type of sorting, consider some other issues.
The amount of data you have: you need to sort ten, one hundred, one thousand, or millions of items.
Algorithm complexity: the more complex, the more tests will need to be done to make sure that it is correct. For small quantities, bubble sorting, or quick sort, itβs easy to code and test verses of other varieties that may be redundant for the amount of data you need to sort.
How long does it take to sort: if you have a large set, it will take a lot of time to create bubbles / quick sort, but if you have a lot of time, this may not be a problem. However, the use of a more complex algorithm will reduce the sorting time, but at the cost of a lot of coding and testing efforts, which can be useful if sorting is from long (hours / days) to a shorter time.
The data itself: is the data close to all the same? For some species, you can get a linear list, so if you know something about the composition of the data, this can help determine which algorithm to choose for the effort.
Amount of resources available: you have a lot of memory in which all the elements are stored, or you need to store items on disk. If everything cannot fit in memory, merge sorting might be better, if the other could be better, if you work with everything in memory.
Glenn
source share