Deep Dive: Worked Example

Part of Binary Search · Section 4 of 8

Study NotesUnit: 3.1 Fundamentals of AlgorithmsGCSE

Find 23 in [2, 5, 8, 12, 16, 23, 38] (positions 0 to 6):

StepLowHighMidpointMiddle itemDecision
10631223 is bigger, keep the right half
246523Equal: found at position 5

Only two items were checked. A linear search would have checked six.

Searching for 10 in the same list: low 0, high 6, mid 3 (12) so high becomes 2. Mid 1 (5) so low becomes 2. Mid 2 (8) so low becomes 3. Now low (3) is greater than high (2), so 10 is not found.

This study notes covers Deep Dive: Worked Example within Binary Search for GCSE Computer Science. Revise Binary Search in 3.1 Fundamentals of Algorithms for GCSE Computer Science with 15 exam-style questions and 10 flashcards. This is a high-frequency topic, so it is worth revising until the explanation feels precise and repeatable. It is section 4 of 8 in this topic. Use this study notes to connect the idea to the wider topic before moving on to questions and flashcards.

Practice questions for Binary Search

Which of the following is a requirement before binary search can be used?

  • A. The list must contain an even number of items
  • B. The list must be sorted in order
  • C. The list must be stored in a 2D array
  • D. The target value must be in the first half of the list
1 markfoundation

Describe how a binary search algorithm finds a target value in a sorted list.

3 marksstandard

Quick recall flashcards

What is the time complexity of binary search?
O(log n) - logarithmic time
What technique does binary search use?
Divide and conquer - repeatedly halves the search space

15 questions on Binary Search: practise free

Instant marking, adaptive difficulty and spaced-repetition flashcards — all aligned to your exam board.

Start revising free →

PrepWise is a trading name of A3M Quality Solutions Limited, registered in England and Wales, company number 14959172. Registered office: 202 Stroud Road, Gloucester, GL1 5LA. ICO registration ZC267069.