Shell sort

medium

Sort elements that are `gap` apart first, so a badly-placed value jumps most of the distance in one hop, then finish with a gap of 1 on data that is now nearly ordered. The gap sequence is the whole algorithm.

Best O(n log n)Average depends on the gapsWorst O(n²)Space O(1)Not stableIn place
Loading the shell sort engine…

Where to go next