qn on sorting algorithm efficiency

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
I suggest looking them up on wikipedia.

However the question needs a bit of clarification. Are you looking for best case, worst case, or average case?
all 3, is that why some sources state things differently from others, as in they were referring to different cases?
Last edited on
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.

Topic archived. No new replies allowed.