Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

how many comparisons will be made to find 12 in this list using a linea…

Question

how many comparisons will be made to find 12 in this list using a linear search? 1, 8, 15, 12, 16, 3, 8, 10

Explanation:

Step1: Understand linear search

Linear search checks each element one - by - one.

Step2: Check elements in list

The list is 1, 8, 15, 12, 16, 3, 8, 10. We start from the first element 1 (1st comparison), then 8 (2nd comparison), then 15 (3rd comparison), and then 12 (4th comparison). We find 12 on the 4th comparison.

Answer:

4