Shellsort
From Wikipedia, the free encyclopedia
(Redirected from Shell Sort)
![]() Shellsort with gaps 23, 10, 4, 1 in action. | |
Class | Sorting algorithm |
---|---|
Data structure | Array |
Worst case performance | depends on gap sequence |
Best case performance | O(N) |
Average case performance | depends on gap sequence |
Worst case space complexity | O(1) |
[edit] Description
Shellsort is a multi-pass algorithm. Each pass is an insertion sort of the sequences consisting of every h-th element for a fixed gap h (also known as the increment). This is referred to as h-sorting.An example run of Shellsort with gaps 5, 3 and 1 is shown below.

Walang komento:
Mag-post ng isang Komento