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 / prashant gupta

#include<stdio.h>
#include<conio.h>

void main()
{
int i,j,t;
int a[7]={5,7,8,1,4,2,9}; // You can use any length

for(i=0;i<6;i++)
{
for(j=i+1;j<6;j++)
{
if(a[i]>a[j])
{
t = a[i];
a[i] = a[j];
a[j] = t;
}
}
printf("The Sorted Array is = %d",a[i]);

getch();
}

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the best data structure and algorithm to implement cache?

976


How do you sort a collection in descending order?

929


What is time and space complexity of bubble sort?

815


State the properties of b tree.

1056


Can we search the data in a linked list?

945


Which is the parent class of deque class?

942


How is the front of the queue calculated ?

1215


Is arraylist fail fast?

958


Give a good data structure for having n queues ( n not fixed) in a finite memory segment. You can have some data-structure separate for each queue. Try to use at least 90% of the memory space.

961


How does hashset work internally in java?

1018


What do you mean by tree edge?

970


How do you use the sort function?

853


Why quicksort is faster?

856


Which file contains the definition of member functions?

948


what are the applications that use Linked lists?

901