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 / ganga

all the above programs are wrong!!!

heres a perfect one.. simple logic!

for(i=0;i<n-1;i++)
for(j=i+1;j<n;j++)
{
if(a[i]>a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
// now print the elements n see

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write an algorithm to show the procedure of insertion into a b-tree?

888


What are the applications of priority queues?

975


What is data structure explain in detail?

870


What is vector and types of vector?

969


What is the use of sorting?

919


write a program to accept name & sort them?

869


Which is better hashmap or hashtable?

881


What is collision in data structure?

896


How would you use bsearch() function to search a name stored in array of pointers to string?

822


What is internal and external sorting?

885


Is file a data structure?

925


Which algorithm is used in collections sort method?

795


What do you mean by open addressing?

946


Why arraylist is not efficient for manipulation?

827


Explain what do you mean by insertion sort, bubble sort and selection sort? Also, explain the differences among the functionalities of the three sorts.

1017