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

List the differences between comparable and comparator interface?

922


What are types of Collision Resolution Techniques and the methods used in each of the types?

1073


How to traverse data in a linked list in forward and backward direction, write the algorithm?

912


Explain about map and their types?

1005


What is a treeset?

887


What is the meaning of anonymous array? Explain with an example?

1192


What do you mean by Runtime Error

1009


Do you know what is linear search?

891


What do you mean by complexity of search algorithm?

724


What are the disadvantages array implementations of linked list?

926


How can you insert a node to the beginning of a singly linked list?

941


What is garbage collection in data structure?

936


What is the difference between classifying and sorting?

1020


Define in brief an array.

929


Define path in a graph?

915