Question 2(e) 2025 · May-June · Paper 43 · 6 marks
Question 2
Part (e)
Question 2
A program sorts the data in the 1D array DataArray and searches DataArray for specific
values.
DataArray stores 14 integer values and is declared local to the main program.
Part (e)
The function Search() performs a binary search to find ItemToFind in DataArray
The function takes two parameters:
- DataArray, an array of integers
- ItemToFind, an integer to find in DataArray
The function returns:
- the index of ItemToFind if it is in DataArray
- –1 if ItemToFind is not in DataArray
Write program code for Search()
You must not use any inbuilt searching functions for your programming language.
Save your program.
Copy and paste the program code into part 2(e) in the evidence document.
Question 6
Reveal official mark-scheme answer


Official answer for Question 2
Part (e)
Question 1
mark each
Question 6
- Search() header (and close) taking array and integer as parameters
- Looping/recursive calls until no elements left/Low<=High and returning –1 if not found
- … calculating middle index and accessing this value
- … comparison of array at middle value to integer parameter
- … if they are equal return mid
Why this question appears here
60% assigned-topic match · Computational thinking and problem-solving › Recursion
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9618_s25_qp_43.pdf
