Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write programs for Bubble Sort, Quick sort

Answer Posted / nitin jatpuriya

//PROGRAM FOR BUBBLE SORT

#include<stdio.h>
#include<conio.h>
#define SIZE 5
void main()
{
int a[SIZE],n,i,j,temp;
clrscr();
printf("enter the elements ");
for(i=0;i<SIZE;i++)
scanf("%d",&a[i]);
printf("the sorted list is :->\n");
for(i=0;i<SIZE;i++)
for(j=i;j<SIZE-i;j++)
if(a[j]>a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}

for(i=0;i<SIZE;i++)
printf("%d",a[i]);
getch();
}

Is This Answer Correct ?    174 Yes 94 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the complexity of selection sort?

801


What is an object array?

898


How do you use merge sort?

810


List the two important key points of depth first search?

1157


Which is the simplest file structure?

959


What is data structure and why it is important?

880


What are the types of linked list?

855


What is the difference between hashset and hashtable?

877


How is the front of the queue calculated ?

1165


What is a graph?

1890


What are the four characteristics of algorithms?

822


How does insertion sort works?

831


what is the difference between Linear Array and Linked List?

989


How do I remove a value from a list?

807


What is the difference between linked list and array?

913