Donald L. Shell introduced the Shell Sort Algorithm in the year 1959. He improvised the insertion sort algorithm that is why shell sort is also called as “diminishing Insertion sort”. It starts comparison of elements that are separated by a particular distance, the distance decreases on each iteration or pass. The distance or spacing between elements is called “interval” or “gap”.

Shell sort is very efficient in sorting the elements that are widely placed in an array compared to Insertion sort . Insertion sort takes an element and one by one compares & shifts whereas in shell sort it reduces…