summary of comparison-based sorting algorithms the following table summarizes the key properties of all the comparison-based sorting algorithms we have consideredsorting algorithm bubble sort selection sort insertion sort treesort heapsort quicksort mergesort strategy employed exchange selection insertion insertion selection & & objects manipulated arrays arrays arrays/lists trees/lists arrays arrays arrays/lists worst case complexity ( ( ( ( (nlog no( (nlog naverage case complexity ( ( ( (nlog no(nlog no(nlog no(nlog nstable yes no yes yes no maybe yes to see what the time complexities mean in practicethe following table compares the typical run times of those of the above algorithms that operate directly on arraysalgorithm bubble sort selection sort insertion sort heapsort quicksort quicksort mergesort mergesort as beforearrays of the stated sizes are filled randomlyexcept that denotes an array with entries which are already sortedand that denotes an array which is sorted in the reverse order quicksort and mergesort are algorithms where the recursive procedure is abandoned in favour of selection sort once the size of the array falls to or below it should be emphasized again that these numbers are of limited accuracysince they vary somewhat depending on machine and language implementation what has to be stressed here is that there is no 'best sorting algorithmin generalbut that there are usually good and bad choices of sorting algorithms for particular circumstances it is up to the program designer to make sure that an appropriate one is pickeddepending on the properties of the data to be sortedhow it is best storedwhether all the sorted items are required rather than some sub-setand so on non-comparison-based sorts all the above sorting algorithms have been based on comparisons of the items to be sortedand we have seen that we can' get time complexity better than (nlog nwith comparison based algorithms howeverin some circumstances it is possible to do better than that with sorting algorithms that are not based on comparisons