← Back to Sorting Algorithms

Shell Sort

Gap Sequence:
Comparisons: 0
Swaps: 0
Array Accesses: 0
Current Gap: -
Gap Sequence: -
Status: Ready

Shell Sort

Insertion sort with decreasing gaps. Large gaps quickly move elements close to their final position, then small gaps finish the job efficiently.

Time: O(n log² n) to O(n^{4/3})
Depends on gap sequence
Space: O(1) in-place
Stable: No

Arcs connect elements being compared at gap distance. Colors group elements by gap offset.