Any sort of comparison algorithm, the worst-case operating time limit is Ω (NLGN)
Count sort
Assuming that each of the N input elements is an integer between 0 and K, K is an integer, and when K=o (N), the run time of the count sort is θ (n)
1 //input Array A[1..N], holding the sorted result array B[1..N], temporary storage C[0..K]2counting-SORT (a,b,k)3 fori←0to K4 Doc[i]←05 forj←1To Length[a]6 Doc[a[j]]←c[a[j]]+17 fori←1to K8 Doc[i]←c[i]+c[i-1]9 forJ←length[a] Downto1Ten DoB[c[a[j]]]←a[j] Onec[a[j]]←c[a[j]]-1
Base sort
Assuming that the length is N of array A, each element has a D-digit number, where the 1th bit is the lowest, and the D-bit is the highest bit
1 radix-SORT (a,d)2 for i←1 to D3do use a stable sort to sort array a on digit I
Bucket sort
Assuming that the input is produced by a random process, the process distributes the elements evenly across the interval [0,1]
1bucket-SORT (A)2 N←length[a]3 fori←1To N4 DoInsert a[i] into List B[floor (Na[i])5 fori←0to n16 Dosort list B[i] with insertion sort7Concatenate the lists b[0],b[1]... b[n-1] TogetherinchOrder
Introduction to Algorithms learning Notes--The 8th chapter linear time Sequencing