Which sorting algorithm involves repeatedly selecting the smallest element and placing it in its correct position?
Which sorting algorithm involves repeatedly selecting the smallest element and placing it in its correct position?
Solution
Selection Sort scans the unsorted part of the list, picks the smallest element, and swaps it into the next position of the sorted part. Repeating this for every position sorts the whole list.
Bubble Sort: repeatedly swaps adjacent out-of-order elements, so the largest values "bubble" to the end; it does not select a minimum.
Insertion Sort: takes the next element and inserts it into its right place within the already sorted part; it does not search for the smallest element.
Quick Sort: picks a pivot and partitions the list around it, then sorts each part recursively.
Related questions:
2026: 21 May Shift 1
2026: 29 May Shift 2
2026: 26 May Shift 1
2026: 19 May Shift 1
2026: 31 May Shift 1