Internal sorting summary
This blog post we briefly summarize the various internal sorting methods.
Of the 10 sorting algorithms, the first 7 belong to the sort algorithm based on "comparison", it has been proved by decision tree that the time complexity of any sort algorithm based on comparison can not be better than O (N*logn). The following 3 are not based on comparisons, so you can achieve linear uptime.
Below we give a variety of sorting methods of time and space complexity of the table (for their own summary, there is a wrong place, I hope everyone corrected or added).
Back to the column page: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/sjjg/
For a variety of sorts, give the following summary:
The following 3 kinds of sorting efficiency are extremely high, and only under certain conditions can be used, and need additional auxiliary space, if D or K is very large, its performance for main memory ordering is not very good, count sort and cardinal order is most suitable for n very large, and K and D very small situation. In the comparison based sorting method, the fast sorting is best in terms of average performance. For the most common internal sorting application, the preferred method is not the insertion sort, and the hill sort is the quick sort. Merge sorting is generally used only on small or very near-ranked input data, because O (n) of the auxiliary space is required, so its performance is not as good as the main memory ordering, but the central idea of the external ordering when merging. Heap sorting is slower than Hill sort, although it is an O (N*LOGN) algorithm with a remarkably compact inner loop. Some of the better performance based on the internal ranking, only the merge sort is stable, fast sorting, heap sorting and hill sort are not stable, and other simple sorting algorithm is basically stable, except the selection of sorting. In general, for comparison based sorting methods, the sort is stable if the comparison is between adjacent two elements.
SOURCE Package Download
Source code includes: Bubble sort, select sort, insert sort, hill sort, heap sort, merge sort, fast sort, count sort, cardinal sort, etc., do not realize bucket sort.
Full Source package download address: http://download.csdn.net/detail/mmc_maodun/6995321
Author: csdn Blog Lan pavilion Wind and Rain