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 a Breadth First Search? Give a few of its applications.

838


What data structure underlies a python list?

891


What is a hash in programming?

856


Which is better than array and linked list?

883


Explain the term binding time?

878


What do u mean by array?

873


Explain what are the major data structures used in the network data model?

989


What is the difference between hashset and linkedhashset?

936


What is merge sort and how it works?

789


Define non linear data structure.

919


Is hashtable fail fast?

788


What exactly is a thread?

856


What is difference between rb tree and avl tree?

833


Can we remove element from arraylist while iterating?

903


Is array a data type?

809