Shell sort - c program, C/C++ Programming

Shell sort - C Program:

Write a program to define shell sort.

void main()

{                  //program for sorting by select sort

int a[20],i,k,j,n;




printf("How many nos are to be sorted\n");



for (i=0;i<=n-1;i++)


printf("Enter the value of %d no\t",i+1);



printf("Make sure !Are your values read correctly?\n");


for (i=0;i<=n-1;i++)

printf("%d \n",a[i]);


for (i=0;i<=n-1;i++)   //In select sort we consider the 1 st element &

for (j=i+1;j<=n-1;j++) //compare it with the remaining in the 1st step

   {                   //&swaping is done next considering 2nd element etc.

     if (a[i] >= a[j])








printf("The sorted data is\n");

                for (j=0;j<=n -1;j++)




Posted Date: 10/19/2012 3:05:52 AM | Location : United States

Related Discussions:- Shell sort - c program, Assignment Help, Ask Question on Shell sort - c program, Get Answer, Expert's Help, Shell sort - c program Discussions

Write discussion on Shell sort - c program
Your posts are moderated
Related Questions
I need website Product section search box coding section fix Project Description: On our products section in the search box it only searches the name and title of our product

Friend function in c++: class miles; class km  {    float value;    public :   // void input();     km convert(km  ,int a ) ;    void output()    {

I want MODI method''s coding in c++ using all concepts of c++..please help me its my project work...

In rPeANUt implement the "char getchar()" and "void printstring(char *str)" functions. Using these functions implement the following: void main() {    while (1) {       ch

Question 1 / 1 You have an N x N chessboard and you wish to place N kings on it. Each row and column should contain exactly one king, and no two kings should attack each other (two

what are 3 conditions under which the sequential search of a list is preferable to binary search?

C Program for FIND EVEN & ODD NO.S IN THE ARRAY #include stdio.h> #include string.h> #include conio.h> void main() {           int i=0,j=0, l_e[100],l_o[100];

Project Description: I want an experienced programmer to program an RFID tag that will be read (maybe also written), and perform a call to a Filmmaker Pro 13 database. Skills

pseudo code that will determine if the number is prime or composite

Problem : Change to palindrome A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your ta