Skip to content

Course home

Algorithms

Algorithms

EasyMedium
123456789101112131415161718
Question 13

Binary search is an efficient search algorithm that uses a divide-and-conquer strategy.

Here is an ordered list of data values with their corresponding index positions:

Index0123456789
Value581215171922242730

A binary search is executed to find whether the number 14 is in the list.

The midpoint is calculated by adding the low index to the high index and using integer division by 2 (e.g., (low + high) // 2).

Complete the table below to show the values of the low index, high index, and midpoint for each pass of the binary search algorithm until it terminates.

PassLow IndexHigh IndexMidpoint
1
2
3
4
[4]
Markscheme

Algorithms Questions

  1. IGCSE
  2. /Computer Science
  3. /Algorithms

45 exam-style questions on Edexcel IGCSE Computer Science Algorithms. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank