An automated chemical analyzer measures the pH levels of seven sequential samples from an industrial discharge pipe, storing them in a one-dimensional array:
| 5.8 | 4.2 | 6.1 | 3.9 | 7.4 | 5.1 | 6.8 |
Explain why a binary search algorithm cannot be used to find a sample with a pH of 5.1 in this array.
158 exam-style questions on Edexcel GCSE Computer Science Algorithms, covering Constructs for solving problems, Variables, constants and data structures, Arithmetic, relational and logical operators, Tracing algorithm output with trace tables, Types of error and correcting logic errors, Standard algorithms (sorts and searches), and Evaluating algorithm fitness and efficiency. Each one has a worked solution and a markscheme showing where the marks go.