figure insertion sortfifth pass of the sort [ [ [ [ shell sort the shell sortsometimes called the "diminishing increment sort,improves on the insertion sort by breaking the original list into number of smaller sublistseach of which is sorted using an insertion sort the unique way that these sublists are chosen is the key to the shell sort instead of breaking the list into sublists of contiguous itemsthe shell sort uses an increment isometimes called the gapto create sublist by choosing all items that are items apart this can be seen in figure this list has nine items if we use an increment of threethere are three sublistseach of which can be sorted by an insertion sort after completing these sortswe get the list shown in figure although this list is not completely sortedsomething very interesting has happened by sorting the sublistswe have moved the items closer to where they actually belong figure shows final insertion sort using an increment of onein other wordsa standard insertion sort note that by performing the earlier sublist sortswe have now reduced the total number of shifting operations necessary to put the list in its final order for this casewe need only four more shifts to complete the process we said earlier that the way in which the increments are chosen is the unique feature of the shell sort the function shell_sort shown below uses different set of increments in this casewe begin with sublists on the next passn sublists are sorted eventuallya single list sorting