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 )
-
Final squads of the 14 participating teams: Australia: Ricky Ponting (capt), Michael Clarke, Doug Bollinger, Brad Haddin, John Hastings,...
-
China PCPop site, the new Dell UltraSharp 30 - inch LCD screen is preparing U3011 by IPS. My younger sister as the U2711, U3011 IPS LCD pan...
-
Looks like CWG 2010 and Mankatha share certain similarities as the issues take rise during the pre-planning phase. Lots of issues running ...
-
எனது முந்தைய பதிவில் குறிப்பட்டது போலவெ அசல் பர்ஸ்ட் டேய் பர்ஸ்ட் ஷொ பார்தாச்சு. எதிர்பார்த்ததை போலவெ பழி வாங்கும் கதைதான், ஆனால் கொடுத்த வி...
-
Indian Premier League 2011 – Auction Chennai Super Kings No. of players bought : 18 (8 Indian, 10 foreign) Money spent : $8.6 mi...
