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 sort show the best average behavior?

Answers were Sorted based on User's Feedback



Which sort show the best average behavior?..

Answer / suhaan

quick sort

Is This Answer Correct ?    48 Yes 11 No

Which sort show the best average behavior?..

Answer / pavan

Quick Sort

Is This Answer Correct ?    31 Yes 10 No

Which sort show the best average behavior?..

Answer / srinvias

Merge sort. In all the cases the complexity is nlogn
For Quick sort complexity is o(n^2), nlogn in worst and best
cases respectively.

Is This Answer Correct ?    14 Yes 5 No

Which sort show the best average behavior?..

Answer / mr. x

Lots of ppl asked, nobody had a clue.

The best sorting algorithm on average depends on the data to
be sorted. If the data is more or less well evenly
distributed, the best sorting algorithm is Radixsort or
Bucketsort, with average and worst cases of O(n).

Next are a class of very complex algorithms (impractical)
which are O(n log log n).

Next are the O(n log n) algorithms. Mergesort and Heapsort
both show average and worst case complexities of O(n log n).
Quicksort is to be avoided as the plague!!!!! It has
non-deterministic complexity and has a worst-case behaviour
of O(n^2). No wonder why there are so many crappy
applications out there.

Then Shellsort is pretty good for small-to-medium lists, as
long as you choose the best gaps (around O(n log^2 n)).
Otherwise it can perform O(n^4/3) or even O(n^2)!.

All other sorts are to be avoided, except for very specific
cases or when simplicity is far more important than code
velocity.

Is This Answer Correct ?    10 Yes 4 No

Which sort show the best average behavior?..

Answer / bharath

on avg qsort is O(n) and worst is n^2;
msort is O(nlogn) for all
hsort is same as msort

Is This Answer Correct ?    6 Yes 3 No

Which sort show the best average behavior?..

Answer / shiva

obviously quick sort nly provide best avg behavior....

Is This Answer Correct ?    4 Yes 5 No

Which sort show the best average behavior?..

Answer / ramachandra

heap sort also

Is This Answer Correct ?    7 Yes 13 No

Which sort show the best average behavior?..

Answer / manoj ransing

The worst case behaviour or quick sort is n^2, but that of
heap sort is nlogn. The average case for both is nlogn.

Is This Answer Correct ?    3 Yes 10 No

Which sort show the best average behavior?..

Answer / kingkong

Shell Sort is the best.

Is This Answer Correct ?    1 Yes 17 No

Post New Answer

More Data Structures Interview Questions

Explain Queue

0 Answers   Tech Mahindra,


Which sorting is best in time complexity?

0 Answers  


What do you know about traversal in linked lists?

0 Answers  


Define a path in a tree?

0 Answers  


What is the types of data structure?

0 Answers  


Differentiate between an array and an arraylist.

0 Answers  


What do you know about the big-o notation and can you give some examples with respect to different data structures?

0 Answers  


Is bucket sort a comparison sort?

0 Answers  


What are the disadvantages of linear list?

0 Answers  


Explain pre-order and in-order tree traversal.

0 Answers  


How to initialize Dictionary using collection initialize?

0 Answers   Wipro,


Write the disadvantages of separate chaining?

0 Answers  


Categories