First, bubble sort
Each round adjacent position comparison, judge Exchange or not, find the wheel max/min, put to the corresponding position, the next round.
Second, choose the sort
Find the largest and smallest places at each time.
Third, insert sort
Each time you judge a number in front of all the worth of the size, find the right place, insert.
Iv. Merging and sorting
The most divided group, 22 merged, makes the group smaller and larger each time the merge is merged in the order of purpose. Key in group merge function (set flag for two groups, move flag bit to determine which number to enter new group)
V. Quick Sort
Randomly select a number, divided by the number of left and right groups. To the left and right two groups to do the above division.
Vi. sequencing of Heaps
The process of building the heap from the N/2 position forwards each person to the left and right children of the comparison and exchange. Swaps the top of the heap with the last value, out of the maximum value. Heap adjustment, from the top of the heap (at this point in case of non-conformance) has been switched down to greater than/less than the child node, the adjustment ends.
Vii. sort of Hill
Improved insertion and drainage
Insert a bit forward. Hill is instead a set step. The step size is lowered until the step is one.
Eight, barrel sorting
Count sort, base sort.
Complexity of Time:
123 N-Square
4567 N*logn
Eight N
Complexity of:
O (1): 12367
O (logn) -0 (N): Five
O (N) Four
O (M) eight (number of barrels)
Stability (the relative order of the same elements in the order of sorts is changed):
Stability: 1348
Instability: 2567
Why is the quick platoon called the Quick Platoon:
Not to say good, but in the best case, its progressive complexity is the same as the heap sort and merge sort, but the constant coefficient of fast sorting is relatively small.
The engineering sort is a comprehensive sort.
Small arrays, inserting rows
An array of large, fast, or O (n*logn) sorts.