Sequential Search1
Sequential Search1
in a list or array.
It works by checking each element in the list one by one until the target element is found or the entire
list has been searched.
How It Works:
Repeat the process until the element is found or the list ends.
If the element is not found, return a message indicating it is not in the list.
Time Complexity:
Worst case: O(n)O(n)O(n) (if the target is at the end or not in the list)
Average case: O(n)O(n)O(n) (since we may have to check half of the elements on average)