Question 1 Report
The table below shows scores from a drone obstacle course. A coach wants an algorithm that ranks the teams with the smallest time first. Fig. 1 gives incomplete pseudocode for a selection sort. During each pass, the algorithm finds the lowest remaining number and places it at the next free position. The data are times in seconds. The code will later display the sorted team list on a scoreboard.
| Team | Time / s |
|---|---|
| Orion | 82 |
| Nova | 76 |
| Comet | 91 |
| Vega | 79 |
(a) Identify the team selected first as the lowest time. [1]
(b) Write the times after the first selection-sort pass. [2]
(c) State the team displayed first after the complete sort. [1]
(a) The lowest time is 76 s, belonging to Nova, so Nova is selected first. [1]
(b) A selection-sort pass finds the lowest remaining value and swaps it into the next free position. Starting with \(82,76,91,79\), swap 76 with 82:
\[82,76,91,79 \rightarrow 76,82,91,79\]
The times after the first pass are 76, 82, 91, 79. [2]
(c) After the complete ascending sort, the first team displayed is Nova. [1] It has the shortest time.
Everything you need to excel in your exams