Question: Trace the execution of the selection sort algorithm as shown in this section when run on the following input arrays. Show each element that will
Trace the execution of the selection sort algorithm as shown in this section when run on the following input arrays. Show each element that will be selected by the algorithm and where it will be moved, until the array is fully sorted.
a. {29, 17, 3, 94, 46, 8, –4, 12}
b. {33, 14, 3, 95, 47, 9, –42, 13}
c. {7, 1, 6, 12, –3, 8, 4, 21, 2, 30, –1, 9}
d. {6, 7, 4, 8, 11, 1, 10, 3, 5, 9}
Step by Step Solution
3.44 Rating (167 Votes )
There are 3 Steps involved in it
All steps of selection sort algorithm ... View full answer
Get step-by-step solutions from verified subject matter experts
