Which of the following describes a disadvantage of selection sort?

Prepare for the Leaving Certificate Computer Science Test with a mix of flashcards and multiple choice questions, each designed to enhance learning. Discover tips and resources for success. Ace your exam with confidence!

Selection sort is indeed easy to implement, but it becomes inefficient as the size of the list increases. This inefficiency arises from its algorithmic complexity. The selection sort algorithm operates by dividing the input list into two parts: the sorted part and the unsorted part. It repeatedly selects the smallest (or largest, depending on sorting order) element from the unsorted part and moves it to the end of the sorted part.

In terms of performance, the selection sort has a time complexity of O(n^2) in all cases (best, average, and worst). This quadratic growth means that as the list size increases, the number of comparisons and swaps increases significantly, making it impractical for sorting large lists. For such scenarios, algorithms with better average-case performance, like mergesort or quicksort, are preferred.

The other options do not adequately address the core disadvantage of selection sort in terms of efficiency for larger datasets. Hence, the aspect of being efficient for large lists and only working with numeric data types do not align with the nature of how selection sort actually operates.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy