Overview
Shell Sort improves on insertion sort by moving values toward their final positions with large gaps before finishing with small gaps.
Sorts by comparing items far apart, then gradually reducing the gap.
Compact metadata for implementation and discovery.
Shell Sort improves on insertion sort by moving values toward their final positions with large gaps before finishing with small gaps.
Quick facts
Runtime and memory behavior at a glance.
Best
O(n log n)
Average
O(n^1.5)
Worst
O(n^2)
Space
O(1)
Show distant values comparing across gaps that shrink over time.
Shell Sort operates in O(n^1.5) time and O(1) space within the Gap Sort family. Often compared with Insertion Sort and Bucket Sort.
What each reference supports for this entry.
Sorting and searching reference covering Shell Sort comparison model, probe strategy, network structure, or pass schedule.
Original Shellsort reference for gap-based insertion passes over internal-memory lists.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Shell sort improves insertion sort by allowing early gapped exchanges before the final insertion pass.