1 Linear - Search
1 Linear - Search
Explanation:
The function LinearSearch takes in two parameters: an array and a
targetValue that we want to search for.
It iterate over the array from the first to the last element.
For each element, we check if it matches the targetValue.
If a match is found, we return the index [i] where the match occurred.
If no match is found after scanning the entire array, we return -1 to indicate
that the targetValue is not present in the array.