Relationship Hill sorting and insertion sort

Improved Algorithm for a shell sort is performed on the basis of insertion sort, Shell sort a prosequence is divided into subsequences, for each sub-sequence are performed once the insertion sort, and divided according to different sequences size, last sequence is 1, the insertion sort of that time with the original insertion sort is exactly the same, and now more than just an orderly queue than the original.

So Shell sort is the original sequence of some sort, it will become the order number, and we all know that, for insertion sort O (N2) algorithm this level, the more orderly sequence, it needs the less time, and even in some cases approaching O (N), which is modified to Hill sorting insertion sort.

Guess you like

Origin www.cnblogs.com/cold-windy/p/11183117.html