Shellsort, also known as Shell sort or Shell's method, is an in-place comparison sort. It can be understood as either a generalization of sorting by exchange (bubble sort) or sorting by insertion (insertion sort) . The method starts by sorting pairs of elements far apart from each other, then progressively reducing the gap between elements to be compared