24 functions of various sorting time complexity analysis
1 Stable sorting
1) Bubbling
2) Insert
3) Merge
2 Unstable sorting
1) Selection sorting
2) Hill sort
3) Quick sort
Refer to quick sort analysis
4) Heap sorting
Refer to add link description
3 Finally, a summary table of various sorting O(N) and the use occasions of sorting are given
1) bubbling, selection, insertion, priority selection insertion. Because the O(N) of bubbling and selection is N^2, the best case of insertion cannot be achieved, and insertion is a stable sort.
2) When the data is ordered, it is very efficient to use insertion and Hill sorting;
3) When merging files, choose merge sorting. Of course, using heap sorting is not a big problem, because sometimes it is difficult to compare their specific efficiency , Well instability.
4) Fast sorting is an efficient sorting. When the sentinels fetched each time just divide the array equally, the efficiency is the best. Under normal circumstances, it is a good choice to use fast sorting.