QUESTION IMAGE
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
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.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
4