Linear Search Algorithm
Algorithm Steps:
- Start at the first element of the array.
- Compare the current element with the target value.
- If they match, return the index of the current element.
- If not, move to the next element in the array.
- Repeat the process until you find the target or reach the end of the array.
- If the target is not found, return a value indicating that it is not present (often -1).
Example:
For instance, to find the number 8 in the list [12, 25, 8, 10, 32], the algorithm will check each element one by one until it finds the number.