+ 2

Which sorting method is best?and why?

15th Oct 2018, 2:05 PM
Somanathareddy
Somanathareddy - avatar
6 Réponses
+ 6
https://www.sololearn.com/learn/774/?ref=app 'When choosing a sorting algorithm, you need to consider the amount of data you are sorting and how much time you have to implement the algorithm. For example, QuickSort is a very efficient, but can be pretty tricky to implement. Bubble Sort is simple to implement, but slow. To sort small sets of data, Bubble Sort may be a better option since it can be implemented quickly, but for larger datasets, the speed of QuickSort might be worth the work of implementing the algorithm.' You can't say xyz is algorithm is best for any sorting!!
15th Oct 2018, 2:11 PM
Roneel
Roneel - avatar
+ 5
It also depends on the specific case. If you have a list with 5 million items and only the first two elements are unsorted, bubble sort might be noticeably faster than quick sort
15th Oct 2018, 2:27 PM
Anna
Anna - avatar
+ 2
thanks both
15th Oct 2018, 2:51 PM
Somanathareddy
Somanathareddy - avatar
+ 1
Check my code for sorting set of numbers (array) : https://code.sololearn.com/cxjhxc6ywwqL It may help you. Thanks!
26th Oct 2018, 11:19 AM
Dinesh Bala
Dinesh Bala - avatar
+ 1
Quick sort and Merge sort follows divide and conquer strategy and has good time complexity. They can be implemented for larger data sets. For smaller data sets, you may apply simple Bubble sort or Selection sort which are easier to implement.
1st Apr 2019, 3:32 AM
Dinesh Bala
Dinesh Bala - avatar
0
in big data cases good data preparation and combining matters much more than particular algoritm. so well prepared and splited datasets are better and faster to use without sorting and long searches. you might save data in a right way on the fly. just a note from a conference
15th Oct 2018, 3:27 PM
Sergei No
Sergei No - avatar