Kizspy | Question: 17
(Choose 1 answer)
(See picture)
A. 9
B. 4
C. 22
D. 10
E. None of the other choices is correct
Given the Linear Search algorithm
Procedure TKTT(a1,a2,..., an: distinct integers, X: integer)i:=1while (in) and (x ≠ ai)i:=i+1if in then location: = i else location:=0
How many comparisons are used to search for the number x = 4 in the list 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.