Here is a summary of the algorithms we have considered:
| strategy | objects | worst case | average case | |
| algorithm | employed | manipulated | complexity | complexity |
| Selection Sort | Selection | arrays | ||
| Insertion Sort | Insertion | arrays/lists | ||
| Bubblesort | Exchange | arrays | ||
| Heapsort | Selection | arrays |
|
|
| Quicksort | D & C | arrays |
|
|
| Mergesort | D & C | lists/arrays |
|
|
| Treesort | Insertion | lists |
|
But what does it all mean in practice? Here is a table comparing the performance of those of the above algorithms that operate on arrays. It should again be pointed out that these numbers are only of restricted significance, since they can vary somewhat from machine (and language implementation) to machine. Quicksort2 and mergesort2 are algorithms where the recursive procedure is abandoned in favour of Selection Sort once the size of the array falls to 16 and below.
| algorithm/size | 128 | 256 | 512 | 1024 | O1024 | R1024 | 2048 |
| Selection Sort | 12 | 45 | 164 | 634 | 643 | 833 | 2497 |
| Insertion Sort | 15 | 69 | 276 | 1137 | 6 | 2200 | 4536 |
| Bubblesort | 54 | 221 | 881 | 3621 | 1285 | 5627 | 14497 |
| Heapsort | 21 | 45 | 103 | 236 | 215 | 249 | 527 |
| Quicksort | 12 | 27 | 55 | 112 | 1131 | 1200 | 230 |
| Quicksort2 | 6 | 12 | 24 | 57 | 1115 | 1191 | 134 |
| Mergesort | 18 | 36 | 88 | 188 | 166 | 170 | 409 |
| Mergesort2 | 6 | 22 | 48 | 112 | 94 | 93 | 254 |
What has to be stressed is that there is no `best sorting algorithm'. There usually is a best sorting algorithm for particular circumstances and it is up to the program designer to make sure the appropriate one is picked.