Skip to the content.
Home This week's review ticket Replit code team repository Tech Talks Lecture Notes

Data Tables

Sort swaps(per case) comparisons(per case) total time of all 12 tests avg time highest time lowest time
Bubble 6.1 to 6.3 million 12497500 1.67 seconds .14 seconds .236 seconds .124 seconds
Selection 4999 12502499 .422 seconds .0352 seconds .0618 seconds .0279 seconds
Insertion 6.1 to 6.3 million 12.5 to 12.6 million .385 seconds .0321 seconds .0638 seconds .0269 seconds
Merge 0 55000 .09 seconds .0076 seconds .0259 seconds .00299 seconds

Conclusion of Sorting ALgorithms

The three sorts except merge all have little memory requirements however are slower than merge

Merge sort is the fastest however it requires the most memory as dataset becomes bigger, this is further enforced by its time and space complexity

Bubblesort is the slowest, followed by selection then insertion

Bubble, insertion, and selection time complexity make them inefficient at larger data sets

My opinion:

I would select merge sort for faster speed times as long as memory is not important

If memory was important than I would select insertion sort for its faster times and low memory requirements