78.7k views
3 votes
If a selection sort is used to arrange the numbers 7 5 3 9 2 6 in ascending order (positioning the smallest first), what order will the data be in after the first pass?

A) 2 5 3 9 7 6
B) 2 5 7 9 3 6
C) 2 5 3 6 9 7
D) 2 3 5 9 7 6

User Ruttydm
by
6.6k points

1 Answer

2 votes

Final answer:

In the first pass of the selection sort algorithm, the smallest number will be selected and moved to the first position. In this case, the order of the data after the first pass will be 2 5 3 9 7 6.

Step-by-step explanation:

In the first pass of the selection sort algorithm, the smallest number will be selected and moved to the first position. In this case, the smallest number is 2, so it will be moved to the first position. The rest of the numbers will remain in the same order.

So, the order of the data after the first pass will be 2 5 3 9 7 6.

User Myradio
by
7.4k points