Skip to content

Course home

Searching algorithms

Searching algorithms

EasyMediumHard
12345678910111213141516171819202122
Question 15

An automated weather monitoring network stores active telemetry node data in a database. The database contains a sorted array of sensor IDs:

Index0123456
Sensor ID104112118125131145150

State the values that would be compared, in order, if a binary search algorithm was used to search for the sensor ID 118 in this array.

Note: The midpoint index at each step is calculated using integer division: midpoint=⌊(lower+upper)/2⌋\text{midpoint} = \lfloor(\text{lower} + \text{upper}) / 2\rfloormidpoint=⌊(lower+upper)/2⌋.

[3]
Markscheme

Searching algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Searching algorithms

33 exam-style questions on AQA GCSE Computer Science Searching algorithms. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank