Search This Blog

Saturday, September 10, 2011

A Program for Selection Sort Algorithm...!!

/*Selection sorting selects the initially the first element as minimum valued and compare it with the all elements*/
***************************************************************************
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#define FNAME1 "best case"
#define FNAME2 "avg case"
#define FNAME3 "wrost case"

FILE *f1,*f2,*f3;
void main()
{
 int i,j,ch,n,k,min,minpos,a[10000];
 int count=0;
 clrscr();
 printf("1-> Best case\t2-> Average case\t 3-> Worst case\n\n");
 printf("Enter your choice:");
 scanf("%d",&ch);
 printf("Enter the size of elements of file\t:");
 scanf("%d",&n);