Order the binary search
Exercise and reference answers
- Steps
- Make sure the list is sorted
- Look at the middle element
- Compare it with the key
- Discard the half that cannot hold it
- Repeat on the half that remains
- Instructions
- Tap the steps of a binary search in order.
Explanation
_Source: syllabus Computer Science, Ch 5 'Sorting' and Ch 6 'Searching'_