C Program for Sorting an Array using Shell Sort using Knuth increments

By | September 17, 2017

Shell Sort using Knuth increments


Write a C Program for Sorting an Array using Shell Sort using Knuth increments.  Here’s simple C Program for Sorting an Array using Shell Sort using Knuth increments in C Programming Language.


Shell Sort


Shell Sort is mainly a variation of Insertion Sort. In insertion sort, we move elements only one position ahead. When an element has to be moved far ahead, many movements are involved.

The idea of Shell Sort is to allow exchange of far items. In Shell Sort, we make the array h-sorted for a large value of h. We keep reducing the value of h until it becomes 1.

An array is said to be h-sorted if all sub lists of every h’th element is sorted.

Time Complexity: Time complexity of Shell Sort is O(n2).


Also Read : : C Program for Sorting an Array using Insertion Sort

Below is the source code for C Program for Sorting an Array using Shell Sort using Knuth increments which is successfully compiled and run on Windows System to produce desired output as shown below :


SOURCE CODE : :



OUTPUT  : :



If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach up to you in short interval.


Thanks for reading the post…


Recommended Posts : :

Leave a Reply