know the personalities
hold your mouse,move left and right

Program to sort the given number using divide & conquer technique.


job detailsFree Publishing of valuable information(s) in our website-Procedure to submit detailsjob details

Free Publishing of your College/University function details


Free Publishing of Your College/University function details in our website.Please send details to following email ids


technicalsymposium@gmail.com.
technicalsymposium@in.com.
technicalsymposium@yahoo.com.
technicalsymposium@hotmail.com.
Google Groups

Get Free E-Mail Alerts Daily

Get Daily Job/EntranceExam/Scholarships/
Admission/Competitive Exam Details Symposium/Conference Alerts in your email

Please Enter your email id and go to your inbox and confirm.You will be a member in our group.

Email:
Visit this group

Freshers Jobs/Symposium/Conference/Certification &Education News Given Below-Get Now

Freshers Jobs and IT /Govt Jobs

Symposium and Conference Details

Free Lecture Notes

Free Placement Papers

Free Project Codings


                

/*pgm to sort the given number using divide & conquer technique*/
#include<stdio.h>
void merge(int [],int [],int [],int,int);
void mergesort(int [],int);
void main()
{
int a[15],n,i;
clrscr();
printf("\n\n\t\tMERGE SORT USING DIVIDE & CONQUER TECHNIQUE\n\n");
printf("\n\tEnter the No. of elt in the list : ");
scanf("%d",&n);
printf("\n\n\t\tEnter the Elements : ");
for(i=0;i<n;i++)
scanf("%d",&a[i]);
mergesort(a,n-1);
printf("\n\n\t\tSORTED LIST \n\n\t");
for(i=0;i<n;i++,printf("\t"))
printf("%d",a[i]);
getch();
}
void mergesort(int a[],int n)
{
/* Fn. to divide & conquer the list to sort*/
int b[10],c[10],i,j,k;
if(n>=1)
{
/*dividing*/
k=n/2;
for(i=0;i<=k;i++)
b[i]=a[i];
for(j=0;i<=n;j++)
c[j]=a[i++];
mergesort(b,k);
mergesort(c,j-1);
/* conquering*/
merge(a,b,c,k,j-1);
}
}

Hosting by Yahoo!

About-Us    Contact-Us    Site-map

©copyright 2009 All rights are reserved to technicalsymposium.com