Computer Science, asked by AbithaJ, 13 days ago

write an algorithm to search an element in an array using linear search method​

Answers

Answered by 00SweetGirl00
20

Answer:

\huge\mathfrak{Answer}

In every iteration, compare the target value with the current value of the array. If the values match, return the current index of the array. If the values do not match, move on to the next array element.

Answered by shrigourip
0

Explanation:

Traverse the array using a for loop.

In every iteration, compare the target value with the current value of the array. If the values match, return the current index of the array. If the values do not match, move on to the next array element.

If no match is found, return -1 .

Similar questions