can someone rank among all these sorting algorithms from least to most efficient since I found some conflicting statements about which is more efficient and such?
selection sort
insertion sort
bubble sort
shell sort
merge sort
heap sort
quick sort
rank them this way:
Least efficient
|
|
Most efficient
Guest_User is online now Report Post Edit/Delete Message
Yes - for example, the average case for bubble sort is O(n^2) and for quicksort O(log n) which means that in the average case quicksort is faster. But, in the worst case, quicksort has a runtime of O(n^2) which is as bad as bubble sort.
Thanks for posting the link, helios, I was too lazy to go there and post it myself :)
Check out helios' link if you haven't already and if you have specific questions we can help you.