# hw-sorting - pass 4 pass 5 pass 6 pass 7 pass 8 19 27 9 12...

This preview shows pages 1–3. Sign up to view the full content.

Sorting Worksheet Directions In each problem, show the state of the array after each pass of the outer loop of the sort, as shown in the examples at the beginning. Indicate swaps with arrows in selection and insertion sorts. In all sorts, label where the bottom is after each pass. Examples Click here for two example traces of sorts. Problems 1. Sort ascending using selection sort. original pass 1 pass 2 pass 3 pass 4 pass 5 pass 6 pass 7 19 27 9 12 23 31 6 14 2. Sort descending using bubble sort. original pass 1 pass 2 pass 3 pass 4 pass 5 pass 6 pass 7 19 27 9 12 23 31

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6 14 3. Sort ascending using insertion sort. Show original array here: original pass 1 pass 2 pass 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: pass 4 pass 5 pass 6 pass 7 pass 8 19 27 9 12 23 31 6 14 Show new array here: original pass 1 pass 2 pass 3 pass 4 pass 5 pass 6 pass 7 19 27 9 12 23 31 6 14 4. Sort descending using selection sort. original pass 1 pass 2 pass 3 pass 4 pass 5 pass 6 -43-17 28 13 9 32 7 5. Sort ascending using bubble sort. original pass 1 pass 2 pass 3 pass 4 pass 5 pass 6 -43-17 28 13 9 32 7 6. Sort ascending using insertion sort. Show original array here: original pass 1 pass 2 pass 3 pass 4 pass 5 pass 6 -43-17 28 13 9 32 7 Show new array here: original pass 1 pass 2 pass 3 pass 4 pass 5 pass 6 -43-17 28 13 9 32 7...
View Full Document

{[ snackBarMessage ]}

### Page1 / 3

hw-sorting - pass 4 pass 5 pass 6 pass 7 pass 8 19 27 9 12...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online