figure shell sorta final insertion sort with increment of figure initial sublists for shell sort while position >gap and a_list[position gapcurrent_valuea_list[positiona_list[position gapposition position gap a_list[positioncurrent_value a_list [ shell_sort(a_listprint(a_listat first glance you may think that shell sort cannot be better than an insertion sortsince it does complete insertion sort as the last step it turns outhoweverthat this final insertion sort does not need to do very many comparisons (or shiftssince the list has been pre-sorted by earlier incremental insertion sortsas described above in other wordseach pass produces list that is "more sortedthan the previous one this makes the final pass very efficient sorting