CAPE Computer Science Unit 2 · 2009 · Paper 2 · Question 2(b)(ii)
Binary search on an array.
Given arr containing: 7, 10, 15, 17, 18, 25, 35, 37, 40, 45, 50, 55, 56, 57, 58, 62, 63, 71, 75, 78, 81 and key = 40, show your working to determine how many elements will be checked before returning the correct location.
The mark scheme is shown once you've answered.
Practise this question