Linear Search (sequential search)
- simplest search algorithm for finding particular element in a list
- efficient for small lists
- belongs to the “Brute force” strategy
How it works:
each element in list is checked one by one based on a condition until desired element is found
element found => location returned, algorithm stops
Performance:
- Best case: 1 comparison
- Worst case: n comparisons
- Average: (n+1)/2 comparisons
Time complexity:
- Worst case n comparisons: O(n)