Sorting - Worksheet
Sorting - Worksheet
51 64 29 36 43 97 80 19 Original
19 64 29 36 43 97 80 51 Pass 1
19 29 64 36 43 97 80 51 Pass 2
19 29 36 64 43 97 80 51 Pass 3
19 29 36 43 64 97 80 51 Pass 4
19 29 36 43 51 97 80 64 Pass 5
19 29 36 43 51 64 80 97 Pass 6
19 29 36 43 51 64 80 97 Pass 7
Question 2: Apply the Selection sort algorithm to the data listed. Record the data after Pass 4.
A pass is completed each time the algorithm returns to Step 3.
75 41 59 34 87 63 98 22 Original
22 34 41 59 87 63 98 75 Pass 4
Question 2: As you perform the Selection sort on the data set provided, keep track of how
many comparisons and exchanges are performed. Remember to record on the
next line once each pass is complete (Step 3).
51 64 29 36 43 97 80 19 Original
51 64 29 36 43 97 80 19 Pass 1
29 51 62 36 43 97 80 19 Pass 2
29 36 51 62 43 97 80 19 Pass 3
29 36 43 51 62 97 80 19 Pass 4
29 36 43 51 62 97 80 19 Pass 5
29 36 43 51 62 80 97 19 Pass 6
19 29 36 43 51 62 80 97 Pass 7
Question 4: Apply the Insertion sort algorithm to the data listed. Record the data after Pass 4.
75 41 59 34 87 63 98 22 Original
34 41 59 75 87 63 98 22 Pass 4
Question 5: Apply the Insertion sort algorithm to the data listed. Record the data after Pass 6.
48 23 36 95 14 50 61 72 Original
14 23 36 48 50 61 72 95 Pass 6