Write and execute linear search program(Run the code for 3 different search)
Answers
Answered by
1
Explanation:
Linear Search Algorithm
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