Skip to content

Course home

Searching algorithms

Searching algorithms

EasyMediumHard
12345678910111213141516171819202122
Question 5

A communications satellite logs a series of unique, sorted signal frequencies (in kHz) received during a transit. The recorded frequencies are stored in a 1-dimensional array, indexed from 0 to 8:

Index012345678
Frequency104112125131145168172189195

An engineer uses a standard binary search algorithm to locate the frequency 168 kHz in this array. The algorithm calculates the midpoint index at each stage using integer division:

midpoint=⌊lower bound+upper bound2⌋ \text{midpoint} = \lfloor\frac{\text{lower bound} + \text{upper bound}}{2}\rfloor midpoint=⌊2lower bound+upper bound​⌋

State, in order, the frequencies from the array that are compared with the target frequency of 168 kHz during this search.

[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