+ 5

What is the best sort algorithm you know?

Please helppp, need to make a homework for tomorrow! Thanks a lot!

28th Jun 2017, 9:43 PM
Ran Avital
Ran Avital - avatar
5 Respuestas
+ 3
bubble sort is an algorithm. I don't get the question. Do you mean what's the fastest sorting algorithm? It really depends on the array / how the data is distributed. Quick sort is very fast performing compared to others for arrays that have fairly random values. Shell sort, merge sort, and tim sort are very good performing on average. Ordered Insertion is great for adding some object to an array (Though that's not sorting). Although, an add on is the insertion sort. Selection sort IMO is the easiest one to code. It's okay on average performance, usually not the best option though. Bubble sort is one of the slowest average performing sorting algorithms. Likely only ever fast if the array is already nearly sorted. But even then, insertion sort may be the better option. Take a look at some algorithms here: https://www.toptal.com/developers/sorting-algorithms/ This can also show you when it's better to use one over the other.
28th Jun 2017, 9:58 PM
Rrestoring faith
Rrestoring faith - avatar
+ 8
✓✓easy way ✓✓with iteration counter ✓✓running time of algorithms ✓✓please check this once https://code.sololearn.com/cY7SC8lmidwy/?ref=app
7th Feb 2018, 6:03 PM
ASIF BILAKHIYA
ASIF BILAKHIYA - avatar
+ 6
Wow thanks!
7th Feb 2018, 6:04 PM
Ran Avital
Ran Avital - avatar
+ 2
Ohhhh I meant the ascending order, not bubble sort. I know the algorithm with the 2 pointers, one for the current and the other for the +1 current and the rest of the array.
28th Jun 2017, 10:02 PM
Ran Avital
Ran Avital - avatar
0
quick sort is best algorithm and it has minimum time complexity O(nlogn).
12th Dec 2017, 3:47 PM
rohit sharma
rohit sharma - avatar