IMPLEMENTATION OF SELECTION SORT
PROGRAM:
#include
#include
int n;
void main()
{
int a[10],i,j;
void selection(int a[10]);
clrscr();
printf("\n\t\tSelection Sort");
printf("\nHow many Elements are there");
scanf("%d",&n);
printf("\nEnter the element");
for(i=0;i
selection(a);
getch();
}
void selection(int a[10])
{
int i,j,min,temp;
for(i=0;i<=n-2;i++)
{
min=i;
for(j=i+1;j<=n-1;j++)
{
if(a[j]min=j;
}
temp=a[i];
a[i]=a[min];
a[min]=temp;
}
printf("\n Sorted List is\n");
for(i=0;i
}
OUTPUT:
Selection Sort
How many Elements are there 5
Enter the element
5
4
3
2
1
Sorted List is
1
2
3
4
5
CIET college Programs,LAB Programs for Engineering Students,DAA LAB Programs,DSA LAB Programs,Remoboys,karthik,Remokn,Student3k,programs source code,Design Analysis And Algorithms LAB Programs,Data Structures and Algorithms LAB Programs,LAB Codings,Coimbatore Institute of Engineering and Technology ( CIET )
Wednesday, September 22, 2010
IMPLEMENTATION OF SELECTION SORT PROGRAMs
9:30 AM
Karthikh Venkat
Popular Posts( Last 7 Days )
-
Asus G73 Gaming Rog nVidia GeForce GTX 3D graphics with 460 offers 1.5 GB of GDDR5 memory and supports NVIDIA 3D Vision, and comes with N...
-
G reen Turtle Tortoise Optical Mouse sells Source Square, and we would say that is good for young girls and children just learning to use ...
-
NAIL CARE : The color of the nails is indicators of good health or sickness. Healthy nails are transparent and look a little rosy becaus...
-
Healthy glowing hair is a crowning glory for a woman today. To keep it this way is not very simple given to-days living conditions. The h...
-
It is said that the shape of the eyebrows change one`s complexion in a good way, and it is true indeed. If you give them a nice shape, yo...