Advertisements
Advertisements
Question
Using linear search determine the position of 8, 1, 99 and 44 in the list:
[1, -2, 32, 8, 17, 19, 42, 13, 0, 44]
Draw a detailed table showing the values of the variables and the decisions taken in each pass of linear search.
Short/Brief Note
Advertisements
Solution
Element 8 is found at position 4 after 4 comparisons.
Element 1 is found at position 1 after 1 comparisons.
Element 99 is not found in the list.
Element 44 is found at position 10.
shaalaa.com
Linear Search in Python
Is there an error in this question or solution?
