Linear search

Numbered cards lie on a shelf in no particular order. Where is the first card marked 14? Check them one at a time from the left.

The scan pointer starts at index 0. Compare the number there with the target.

Return the index at the first match. A later card with the same number does not need to be checked.

A match at the start takes one comparison. A missing target takes n comparisons. Worst-case time is O(n) and extra space is O(1).