(Choose 1 answer)
The following is the main part of selection sort pseudocode:
for i:= 0 to n-2 // large loop
find a[k], where a[k] = min (a[i], a[i+1],...,a[n-1]}
if k # i then swap a[i] with a[k]
end for
Consider the list of ten integers below:7, 5, 11, 12, 3, 10, 2, 4, 8, 6 What is the list after the FIRST TWO iterations of the large loop in a selection sort? (sorting from smallest to largest).
A. 2, 3, 7, 5, 11, 12, 10, 4, 8, 6
B. 2, 3, 11, 12, 5, 10, 7, 4, 8, 6
C. 2, 3, 11, 12, 5, 10, 7, 4, 6, 8
D. 2, 3, 11, 12, 10, 5, 7, 4, 8, 6
Exit 27