perform linear search of the following array when:(a) item=1 (b) item =100
1 9 20 40 50 55 77 96 99
Answers
Answered by
30
the method of finding an element within a linear search or sequential search is called linear search
when we find (a)
i.e
item=1
the loop will run just once and it will return value q
while on the other hand for (b)
item=100
the loop will run 9 times as the number of elements are 9
and it will return with an empty set as 100 is not there in the given data
Answered by
18
FØŁŁØW MƏ ❤❤
hope it HELPS you
Attachments:
Similar questions