I was given this assignment yesterday in class and thought I understood the process of selection sort but I feel a little unsure about it now. I thought that after each pass the numbers on the left become sorted and are not checked again until all the numbers on the right have been sorted first.
Below are the instructions and my answer:
Show the resulting array after each pass of the selection sort algorithm. If the algorithm stops before a given pass is taken, leave that pass blank.
Original Array: 30 8 2 25 27 20
PASS 1: 8 30 2 25 27 20
PASS 2: 8 2 30 25 27 20
PASS 3: 8 2 25 30 27 20
PASS 4: 8 2 25 27 30 20
PASS 5: 8 2 25 27 20 30
Can someone tell me if I did this correctly?