(44)
(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:8, 5, 11, 13, 4, 10, 3, 5, 9, 6
What is the list after the FIRST TWO iterations of the large loop in a selection sort? (sorting from smallest to largest).
A. 3, 4, 11, 13, 5, 10, 8, 5, 6, 9
B. 3, 4, 11, 13, 5, 10, 8, 5, 9, 6
C. 3, 4, 8, 5, 11, 13, 10, 5, 9, 6
D. 3, 4, 11, 13, 10, 5, 8, 5, 9, 6