Which of the following sorting algorithm requires the minimum number of swaps?
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.
Even though selection sort has poor performance, it requires the minimum number of swaps. It does a maximum of n swaps, where n is the number of elements in a list. Once an element is swapped, it will be fixed.
The poor performance of selection sort comes from the high number of comparisons made which is O ( n 2 ) .