Question:

Linear search is useful when:

Show Hint

While binary search has a better time complexity, it requires the data to be sorted. Linear search is the go-to method when the dataset is unsorted or very small.
Updated On: Jun 3, 2026
  • Data is small
  • Data is unsorted
  • Both A and B
  • None
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation


Step 1: Understanding the Question:

The question explores the specific conditions under which linear search is considered practical, efficient, or necessary.

Step 2: Detailed Explanation:

$\bullet$ Linear search compares every element of a list sequentially until the target element is found or the list ends.
$\bullet$ First, consider when data is small: For small lists, the overhead of sorting the list to apply more complex algorithms like binary search is not worth the computational cost.
$\bullet$ Linear search performs very fast in practice for small inputs because of its simple design and minimal overhead.
$\bullet;$; Second, consider when data is unsorted: In an unsorted array, we cannot make any assumptions about where elements reside.
$\bullet$ Because there is no order, we cannot use divide-and-conquer algorithms like binary search.
$\bullet$ Hence, linear search is the only viable standard option to search for a value in an unsorted array.
$\bullet$ Thus, both statements (A) "Data is small" and (B) "Data is unsorted" are correct scenarios where linear search is highly useful and appropriate.

Step 3: Final Answer:

Therefore, linear search is useful under both conditions, making option (C) the correct answer.
Was this answer helpful?
0
0