Concept:
- Worst-case time complexity asks for the maximum number of basic operations an algorithm can ever need, over every possible input of a given size.
- Testing a concrete, specific case first and then generalising the pattern to size $n$ is often clearer than reasoning about best, average and worst cases all at once.
Step 1: Set up a concrete example.
Take an array with $n$ elements, indexed $A[0], A[1], ..., A[n-1]$. Linear search checks $A[0]$ first, then $A[1]$, and so on in order, stopping only when it finds a match.
Step 2: Identify the input that forces the maximum number of checks.
If the target value sits at $A[n-1]$, the very last position, or the target is not present in the array at all, linear search has no way to stop early - it must compare the target against every one of the $n$ elements before it can finish.
Step 3: Count the comparisons for this worst-case input and express it as a function of $n$.
The number of comparisons made is exactly $n$. As $n$ doubles, the number of comparisons doubles too, since every extra element adds exactly one more comparison in this scenario.
Step 4: Confirm by testing the growth rate against the other given options.
For $n = 8$ elements, the worst case needs $8$ comparisons, not $\log_2 8 = 3$ (rules out $O(\log n)$), not $8 \times 3 = 24$ (rules out $O(n \log n)$), and not $8^2 = 64$ (rules out $O(n^2)$). Only direct proportionality to $n$ matches.
Final Answer: $O(n)$