linearsearch
Linear search, also known as sequential search, is a basic search algorithm that checks every element in a list in order until a target value is found or the end of the list is reached. It does not require the data to be sorted, making it simple and broadly applicable to arrays, linked lists, and strings as long as elements can be compared for equality.
The algorithm starts at the first element and compares it with the target. If a match is
Time complexity: in the worst case, every element is examined, giving O(n) time. On average, about n/2
Advantages include simplicity and no requirement for sorting; it works on unordered data and can be used