What does a linear search do?
Explanation
Searching answers two closely related questions: does the target exist, and where is it? The sequential pattern answers both by walking the collection in order, and the same pattern works with arrays, ArrayLists, and the rows of a 2D array.
- A is not correct: Checking only the first element would report failure for every target stored anywhere after index
0, so the traversal would never reach most of the data. - B is not correct: Linear search checks elements in sequence until it finds the target or reaches the end, so sorted data is not required for it to work.
- D is not correct: Looking only at the middle element leaves every other position unexamined, and it is not the one-value-at-a-time traversal that defines a sequential search.