Sorting Algorithm Tutorials - Herong's Tutorial Examples - 6.12, by Herong Yang
Shell Sort - Algorithm Introduction
This section describes the Shell Sort algorithm - A complex and fast sorting algorithm that repeatedly divides the entire collection into sub-collections by taking every h-th element for a fixed gap h and performs an insertion sort each sub-collection.
Shell Sort is a complex and fast sorting algorithm that repeatedly divides the entire collection into sub-collections by taking every h-th element for a fixed gap h and performs an insertion sort each sub-collection. The Shell Sort algorithm was published by Donald Shell in 1959.
The basic idea of Shell Sort algorithm can be described as these steps:
1. Set a step size h that is smaller than the number of elements to be sorted, and greater that 1.
2. Group the entire collection of data elements in h groups by putting elements that are h steps away from each other into the same group.
3. Sort each group by exchanging locations of elements in the same group.
4. Repeat step 2 and 3 with a smaller step size h until h becomes 1.
This idea of sorting is based on the following facts:
Table of Contents
Introduction of Sorting Algorithms
Java API for Sorting Algorithms
Insertion Sort Algorithm and Java Implementation
Selection Sort Algorithm and Java Implementation
Bubble Sort Algorithm and Java Implementation
Quicksort Algorithm and Java Implementation
Merge Sort Algorithm and Java Implementation
Heap Sort Algorithm and Java Implementation
►Shell Sort Algorithm and Java Implementation
►Shell Sort - Algorithm Introduction
Shell Sort - Java Implementation
Shell Sort - Implementation Improvements
Sorting Algorithms Implementations in PHP
Sorting Algorithms Implementations in Perl
Sorting Algorithms Implementations in Python