Selection sort is defined by a simple repeated strategy: divide the list into a sorted region and an unsorted region, then repeatedly select the smallest (or largest) element from the unsorted region and move it to the end of the sorted region. In the common “smallest-first” version, the algorithm scans the unsorted portion to find the minimum element, then swaps it into the next position in the sorted portion. After the first pass, the smallest element is fixed at index 0; after the second pass, the second-smallest is fixed at index 1; and so on until the entire list is sorted.
This exactly matches the description in the question, making selection sort the correct answer. Textbooks often use selection sort to teach algorithmic thinking because it is easy to understand and implement, though not efficient for large datasets. Its time complexity is O(n²) in the average and worst case because it performs roughly n scans of progressively smaller unsorted sections, with each scan taking linear time. Its space usage is O(1) additional space because it sorts in place using swaps.
The other options do not match the described mechanism. Quicksort partitions around a pivot, heap sort uses a heap data structure to repeatedly extract the maximum/minimum, and radix sort processes digits/keys by place value rather than selecting minima by scanning. Selection sort’s defining action is the repeated “select the min/max and place it.”
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit