Question

What are are the relative advantages of the three in terms of the number of comparisons performed and the amount of memory required by the algorithms. Which of them is their running time guaranteed?

Was it helpful?

Solution

I think Wikipedia's coverage of this is pretty thorough and answers all your questions. The comparison table shows the best, average and worst-case performance, the memory usage, and other characteristics like stability.

OTHER TIPS

This is easily answered by looking at Wikipedia...:

http://en.wikipedia.org/wiki/Sorting_algorithm

If you are unsure how to look for the "guaranteed" runtime then you're looking for the worst case.

If you want a visual explanation, this classic animation film called Sorting Out Sorting was made by a University of Toronto CS group in the 1980s. It is worth the watch, covering the three sort types and scenarios where they work best (and also not so well) — and why.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top