Skip to main contentSkip to solution

Consider a list of 11 elements:

7, 12,13, 18, 46, 24, 30, 32, 14, 43, 38.

Determine the number of comparisions linear search makes to search for key = 18.

Solution

✅ Correct Option: 2

Linear search checks elements one by one from the start, and stops as soon as the key is found.

ComparisonElementEqual to 18?
17No
212No
313No
418Yes

The key is found at the 4th position, so the search makes 4\boxed{4} comparisons.


Option 1: 3 is the zero-based index of 18, not the number of comparisons. The count equals position (index + 1).

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question