DOWNLOAD PROGRAM
MORE DATA STRUCTURE PROGRAM IN C
CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
int arr[10],i,n,flag=1,gapsize,temp;
clrscr();
printf("Enter The Number Of Element In The Array:");
scanf("%d",&n);
for(i=0;i1)
{
flag=0;
gapsize=(gapsize+1)/2;
for(i=0;i<(n-gapsize);i++) { if(arr[i+gapsize]>arr[i])
{
temp=arr[i+gapsize];
arr[i+gapsize]=arr[i];
arr[i]=temp;
}
}
}
printf("SORTED LIST ->");
for(i=0;i printf("%d ",arr[i]);
getch();
}
MORE DATA STRUCTURE PROGRAM IN C
CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
int arr[10],i,n,flag=1,gapsize,temp;
clrscr();
printf("Enter The Number Of Element In The Array:");
scanf("%d",&n);
for(i=0;i
{
flag=0;
gapsize=(gapsize+1)/2;
for(i=0;i<(n-gapsize);i++) { if(arr[i+gapsize]>arr[i])
{
temp=arr[i+gapsize];
arr[i+gapsize]=arr[i];
arr[i]=temp;
}
}
}
printf("SORTED LIST ->");
for(i=0;i
getch();
}
Comments
Post a Comment