Question:medium

What is the worst-case scenario for a linear search in an array of 'n' elements?

Show Hint

In Linear Search, the worst-case complexity is $O(n)$ because we must traverse the entire array to find the target if it is at the very end or absent!
Updated On: Jun 11, 2026
  • The target element is the last element
  • The target element is the first element
  • The array is sorted
  • The array is unsorted
Show Solution

The Correct Option is A

Solution and Explanation


Step 1: Understanding the Concept:

Linear search checks each element of the list sequentially until a match is found or the whole list has been searched.

Step 2: Detailed Explanation:

The worst-case scenario occurs when the algorithm has to inspect every single element in the array before finding the target or concluding that the target is not present. This happens when the target is the last element or not in the array at all.

Step 3: Final Answer:

The worst-case is when the target element is the last element.
Was this answer helpful?
0


Questions Asked in CUET (UG) exam