Definition: A process designed to sort an unordered set of linear data into either ascending order (lowest to highest) or descending order (highest to lowest). This is done by creating a gap size equal to half the length of the list and then swapping elements that are [insert gap size] units apart and out of order. Everytime an entire round of the list has been complete, the gap is divided in half and the process is repeated until the gap size is equal to 1.
Procedure for ASCENDING Shell Sort:
Fun Fact #1: It is considered usual to choose your own gap size sequence for shell sort rather than just dividing by 2 every round. This could potentially improve the speed of the algorithm. A common choice is the Knuth Sequence, where the expression (3^k-1)/2 (k = the round you are in) dictates the gap size until the result exceeds the length of the data being sorted.
Fun Fact #2: Shell sort isn't named after a shell to describe its sorting strategy, it's named after the algorithm's inventor Donald Shell.
Commonly Used In:
Note: Other algorithms such as quick sort and merge sort tend to be preferred over shell sort for most operations.