A weather station sends wind-speed readings to a computer. Fig. 1 shows one selection-sort step on the readings, measured in km/h. The outlined values have ...

Assessment: Computer Science 9210 | Paper 2 Mock 01 | Concepts and principles of computer science Subject: Computer Science - 9210

Question 1 Report

A weather station sends wind-speed readings to a computer. Fig. 1 shows one selection-sort step on the readings, measured in km/h. The outlined values have been checked to find the smallest value in the unsorted section. The computer will sort the array from low to high.

Position already fixedUnsorted section6189413smallest found

(a) State the value that selection sort has found. [1]
(b) Give the array after this selection-sort step. [2]
(c) State the index of the next position that will be fixed, if the first index is 0. [1]

Answer Details

Selection sort leaves already fixed values untouched and finds the minimum in the remaining unsorted section.

  1. (a) The smallest value found is 4. [1]
  2. (b) The first unsorted position contains 18, so selection sort swaps 18 and 4. The array becomes 6, 4, 9, 18, 13. [2]
  3. (c) Index 0 is already fixed by 6, and this step fixes index 1. The next position to be fixed is therefore index 2. [1]

Download The App On Google Playstore

Everything you need to excel in your exams

Green Bridge CBT Mobile App
Personalized AI Learning Chat Assistant
200,000+ Exam Questions Across IGCSE, JAMB, WAEC & NECO
Over 3,900 Lesson Notes
Offline Support - Learn Anytime, Anywhere
Green Bridge Timetable
Literature Summaries & Potential Questions
Track Your Performance & Progress
In-depth Explanations for Comprehensive Learning