Computing Atlas

How Computing Was Built
Sign In
Text size
100%
Theme
Algorithm

Shellsort Algorithm

Sorting Algorithm

Shellsort sorts an array by repeatedly performing an insertion sort on subsequences of elements spaced apart by a decreasing gap sequence, starting with a large gap that lets far-apart out-of-place elements move quickly toward their correct position, and finishing with a gap of one, an ordinary insertion sort pass, on an array that is by then already nearly sorted and so fast to finish. Donald Shell published the method in 1959, one of the earliest sorting algorithms to improve meaningfully on the O(n squared) running time of simple insertion sort, though its exact running time depends heavily on the chosen gap sequence and remains an open area of study. It requires no extra memory beyond the array itself, an in-place sorting algorithm.

Facts
Time Complexity
O(n^2) for the worst known worst-case gap sequence; O(n log^2 n) for the best known worst-case gap sequence 1
Credited To
Donald Shell 1
Time Complexity
Time Complexity (category)
Quadratic Time -- O(n^2) 1
Connections

Credited To

Donald Shell, Pioneers
Source Wikipedia: Shellsort

In Field

Source Wikipedia: Shellsort

Invented By

Donald Shell, Pioneers
Source Wikipedia: Shellsort
Sources
1. Wikipedia: Shellsort
  • Infobox: time
    O(n 2 ) (worst known worst case gap sequence) O(n log 2 n) (best known worst case gap sequence)
  • Lead section
    The algorithm was first published by Donald Shell in 1959
  • In Field: Algorithms and Complexity Theory, Lead sentence
    Shellsort, also known as Shell sort or Shell's method, is an in-place comparison sort.
View the Source
Comments (0)
No comments yet. Be the first to share a thought.
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.