Consider any given comparison sort. What is the least number of comparisons in the worst case it has to do in order to sort 5 numbers?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Example:
Quick sort:
4 5 3 1 2
Compare [4] times (45, 43, 41, 42):
3 1 2 [4] [5]
Compare [2] times (31, 32):
1 2 [3] [4] [5]
Compare [1] time (12):
[1] [2] [3] [4] [5]
Total = 4+2+1 = 7