Count absent targets under early stopping

A device stores the integer identifiers [12, 19, 31, 44] in ascending order. Its sequential search starts at index 0 and checks one stored integer at a time:

  • If the stored integer equals the target, report found and stop.
  • If the stored integer exceeds the target, report absent and stop.
  • Otherwise, continue to the next item; if no items remain, report absent.

One item inspection means examining one stored integer, regardless of how many relational tests are used for that item. The search never skips an item before stopping.


A scatter plot shows stored integers 12, 19, 31, and 44 at indices 0 through 3.


The target can be any integer from 10 through 49, inclusive. Consider only targets absent from the list. How many distinct target values cause exactly three item inspections, and how many cause exactly four item inspections? Give each count as an exact integer.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Sequential Search Questions: