Edexcel 1CP2 1.2.6: Standard sorting and searching algorithms
The free BugBot lessons that teach this point, a robot to try it on, and the past-paper questions that test it.
What it covers
Searching is one of the jobs computers do most: finding a name in a contact list, a word in a document, a marker in a robot's camera log. The simplest search algorithm looks at every item in turn until it finds the one it wants. That is linear search, and this lesson has the robot use it to find a marker in a ring around it.
- The algorithm
- Counting the work
- Searching what the robot sees
- When linear search is the right choice
Or do it in the simulator, with tasks that mark themselves
Lessons that teach it
- F5.5 Linear search Algorithms
Checking every item: finding a marker in the robot's sightings. - F5.6 Binary search Algorithms
Halving a sorted list, and why it needs sorted data. - F5.7 Bubble sort Algorithms
Passes and swaps, stopping early, and hearing a tune become a scale. - F5.8 Insertion sort Algorithms
Building a sorted part one item at a time, on the robot's readings.
Try it on a robot
The task from F5.5 Linear search, running here. Change the program and press Run.
Past paper questions on this
Real exam questions that test this, each worked through with a program you can run.
- AQA 8525 June 2025 Paper 1, Question 6: Show a bubble sort and a merge, compare them, and justify a binary search 10 marks
- AQA 8525 June 2023 Paper 1, Question 12.1: Trace a binary search 4 marks
- AQA 8525 June 2023 Paper 1, Question 12.2: Write your own linear search 7 marks
- AQA 8525 June 2022 Paper 1, Question 12: Trace a bubble sort on three items 8 marks
- AQA 8525 Sample Paper 1, Question 7: A bubble sort with a swapsMade flag: data type, identifiers, and a trace table 10 marks
- OCR J277 June 2024 Paper 2, Question 3(c): Show a binary search for 10, its pre-requisite, and name merge sort 5 marks
- OCR J277 June 2024 Paper 2, Question 9(a)(ii): Complete a linear search function 4 marks
- OCR J277 June 2023 Paper 2, Question 3: Insertion sort: temp, the inner loop, and bubble sort compared 8 marks
- OCR J277 June 2022 Paper 2, Question 3(b), (c): Describe a binary search, and a linear search for a number that is not there 6 marks
- OCR J277 Sample Paper 2, Question 6: Show a bubble sort on words and a binary search for zebra 8 marks
- Edexcel 1CP2 June 2025 Paper 1, Question 5(d), (e): Computational thinking: best and worst cases, and a binary search table for a missing value 10 marks
- Edexcel 1CP2 June 2024 Paper 1, Question 1: Computational thinking: constructs by line number, errors, operators, and search and sort names 16 marks
The specification is Edexcel's own document; this page says which of our lessons teach point 1.2.6 and is not endorsed by the board.