Answer:
c) 2, 4, 12, 9, 6, 8, 18
Explanation:
The given list of numbers given in the array is: 9, 4, 12, 2, 6, 8, 18
We start selection sort by scanning the entire given list to find its smallest element and exchange it with the first element, putting the smallest element in its final position in the sorted list. Then we scan the list, starting with the second element, to find the smallest among the last n − 1 elements and exchange it with the second element, putting the second smallest element in its final position.
During the first pass, 2 is the smallest element, it will be moved to index 0 and 9 which was in index 0 will replaced 2 in it initial position.