The Search Problem
Linear Search: Find (the value of) x in array b.
This description is too vague, for several reasons:
- How are we to indicate that x appears in b?
- What if it appears more than once in b?
- What is to be done if x is not in b?
In general, when approaching a new programming job, the first task is to make the specification of the job as precise as possible.