Insert, Hill, selection sort

Sort:
typically sorted in situ (In-place)
Sort: default is non-descending order by
stability: the sorting process to ensure that the relative order of data equal to the constant
1. The closer :( insertion sort order, the higher the execution time efficiency)
Save treatment sorting algorithm (direct insertion sort, insertion sort binary)
total required size-1 insertion,
the insertion process: random number each time the first interval, the interval traversal in the ordered (from previous traversing)
1) to find a suitable position
2) move the original data, to make room for the data
2. Shell sort :( by inserting the ordering, the closer ordered, higher time efficiency)
to do before insertion sort pre-sorting (packet inserted row), so that the data ordered as close as possible
to each packet and then the insertion sort, the number of sub-groups of gap = gap / 3 + 1;
until exit gap == 1
3. selection Sort :( direct selection sort, heap sort)
minus conquer algorithm
each iteration unsorted ranges (direct traversal, use the heap), find the maximum number of unsorted ranges of
the maximum number of edges into the final unsorted ranges
have been selected n- after the (n) number 1, the data is completely Order
the most important thing is to determine the order and disorder range
stack Sort:
ascending order, then piles must be built
in descending order, they must build a small heap

Guess you like

Origin blog.51cto.com/14232274/2437960