Multiple choice › Sorting
Sorting
1. Sorting
The list 7 9 2 4 1 is being sorted. After the first pass the list becomes 7 2 4 1 9. Which of the following shows the result of the next pass?
- 1 2 4 7 9
- 2 4 1 7 9
- 2 7 4 1 9
- 7 2 1 4 9
Answer
B
NESA answer key: B. Bubble-sort pass: 7,2 swap; 7,4 swap; 7,1 swap gives 2 4 1 7 9. Old syllabus (SDD): useful as overlap practice only.