Sort algorithms home |
Java | C | FORTRAN | PASCAL
sort simple sort In-place sort quicksort balanced quicksort introspective sort insertion sort selection sort diminishing increment sort shell sort heapsort adaptive heap sort introspective sort adaptive sort adaptive heap sort distribution sort bin sort range sort counting sort histogram sort merge sort |
diminishing increment sort
Inherits from In-place sort
An in-place sort algorithm which repeatedly reorders different, small subsets of the input until the entire array is ordered. On each pass it sorts i sets of n/i items, where n is the total number of items to sort. Each set is every ith item, e.g. set 1 is item 1, 1+i, 1+2i, etc., set 2 is item 2, 2+i, etc. Typically each set is sorted with an insertion sort. On each succeeding pass, the increment, i, is reduced until it is 1 for the last pass. [National Institute of Standards and Technology]
Demonstrations: | http://www.cs.ubc.ca/spider/harrison/Java/sorting-demo.html
Implementations and sample code: | http://www.cs.ubc.ca/spider/harrison/Java/ShellSortAlgorithm.java [Java]
See also diminishing increment sort variants: shell sort