Shellsort
Shellsort is a sorting algorithm, a generalization of insertion sort. It was invented by Donald Shell in 1959. The key idea behind Shellsort is to compare elements that are far apart from each other. This is achieved by sorting the list in passes. In each pass, elements are sorted that are a certain distance apart, known as the gap. The gap sequence decreases over successive passes until the final pass, where the gap is 1. A gap of 1 effectively turns Shellsort into a standard insertion sort, but by this point, the list is already mostly sorted, making the final insertion sort very efficient.
The efficiency of Shellsort depends heavily on the chosen gap sequence. Several gap sequences have been proposed
Shellsort's time complexity is not as well-understood as some other sorting algorithms like mergesort or quicksort.