Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Rich Cook

Shell sort

Language Java | Level Intermediate | Category Algorithms | August 3, 2015 7:52 am

Algorithm Problem Description

Shell sort is a sorting algorithm that starts by sorting pairs of elements far apart from each other, then progressively reducing the gap between elements to be compared. Shell sort is a variation of insertion sort. Shell sort is a generalization of insertion sort.

Write a program to implement the shell sort.



Unsorted array before sorting: [12, 11, 13, 5, 6, 7]
Sorted array After Shell sort sorting: [5, 6, 7, 11, 12, 13]



Please login to add comments.