Skip to content

Course home

Searching and sorting algorithms

Searching and sorting algorithms

EasyMedium
12345678910111213141516171819
Question 16

A sorted list of celestial bodies registered in a space observatory database is indexed from 0 to 8, as shown below:

Index012345678
NameCeresEarthJupiterMarsNeptunePlutoSaturnUranusVenus

Using the binary search algorithm with the midpoint formula ⌊L+U2⌋\left\lfloor \frac{L+U}{2} \right\rfloor⌊2L+U​⌋, where LLL is the lower bound index and UUU is the upper bound index of the current search interval, show the steps required to locate the entry for 'Venus'.

[4]
Markscheme

Searching and sorting algorithms Questions

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

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

Question bank