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...

Which of the following sorts is quickest when sorting the
following set: 1 2 3 5 4




1) Quick Sort


2) Bubble Sort


3) Merge Sort

Answer Posted / sreejesh1987

*I think answer is Bubble sort,because some comparisons are there,but only one swap(4 and 5).

*Best case for for quick sort for this problem applicable to
54321 element set. Here many swaps and comparison will occur.

*Merge sort also does actions of swaps and comparisons.

For most arrays, quick sort and merge sort are better.
But for a simple problem like this, bubble sort consume less operations.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c language still used?

979


What is calloc in c?

1139


Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

2187


What are the types of i/o functions?

1340


Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

2055


What are the disadvantages of external storage class?

1057


Write a program to check whether a number is prime or not using c?

1058


Explain how are portions of a program disabled in demo versions?

1120


How do I swap bytes?

1073


Can a pointer be null?

1028


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2646


What is the difference between union and anonymous union?

1304


Using which language Test cases are added in .ptu file of RTRT unit testing???

4280


What is the difference between malloc() and calloc()?

1860


What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

1466