A linear search will start at the first index in the array and compare the search term to every item until that item is found or the end of the array is reached.
Procedure LinearSearch
myArray(6) Is Integer
SearchValue Is Integer
Found id Boolean
Set Found = False
Input SearchValue
For I = 0 to 6
If SearchValue = myArray(i) then
Set Found = True
Output “Search Value found at position”, I
End If
End For
If Found = False
Output “Search Value not Found.”
End If
<aside> 💡 Divide and conquer (recursive)
</aside>