GeekInterview.com
Series: Subject: Topic:
Question: 29 of 246

Sorting algorithms

Which is the best sorting algorithm and why? I know again that it depends on the implementation but how do you select that a particular one is the best one to implement. In other words what are the factors for selecting a sorting algorithm?
Asked by: anabarai | Member Since Jul-2011 | Asked on: Jul 5th, 2011

View all questions by anabarai   View all answers by anabarai

Showing Answers 1 - 2 of 2 Answers
Shrima Baskar

Answered On : Jul 26th, 2011

View all answers by Shrima Baskar

the best sorting algorithm is quick sort as it is O(nlogn) and will be able to process the input data fast even in case of very large n. In case of small n ,insertion sort is best and when the range of numbers is less(around 1000), quicksort is the best algorithm. If you want a much faster algorithm then you can use stl sort

  
Login to rate this answer.
Damarla Nalini

Answered On : Jul 28th, 2011

View all answers by Damarla Nalini

Quick sort

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.