Question:medium

Linear search works best on:

Show Hint

If a list is already sorted, always prefer binary search over linear search because its time complexity is significantly lower. For unsorted lists, linear search is the standard choice.
Updated On: Jun 3, 2026
  • Sorted list only
  • Unsorted list
  • Binary tree
  • Graph
Show Solution

The Correct Option is B

Solution and Explanation

Step 1: Understanding the Concept:
Search algorithms are mathematical procedures used to find the location of a specific data element within a collection.
The choice of an algorithm depends largely on the "state" or organization of the data set.
Linear search, also called sequential search, is the simplest algorithm and involves checking every element one by one.
Step 2: Detailed Explanation:
Linear search operates by starting at the beginning of a list and comparing the target value with each element sequentially.
If a match is found, the index of that element is returned; if the end of the list is reached without a match, the algorithm reports that the value is not present.
Let's evaluate the different data states provided:
In a Sorted List (Option A), data is arranged in a specific order (ascending or descending).
Because of this order, we can use highly efficient algorithms like Binary Search, which has a time complexity of \( O(\log n) \).
In a sorted list, linear search is considered inefficient because it doesn't take advantage of the existing order to skip elements.
However, when a list is Unsorted (Option B), there is no inherent structure or pattern that we can exploit.
In an unsorted array, we have no way of knowing if the target element is at the beginning, the middle, or the end.
Because we cannot skip any items without the risk of missing the target, a sequential scan (linear search) is the only straightforward and direct method available.
While the worst-case complexity for linear search is always \( O(n) \), it is "best suited" for unsorted lists or small datasets.
For small datasets, the overhead of sorting a list just to perform a binary search is often more computationally expensive than simply performing a linear search.
Binary Trees (Option C) and Graphs (Option D) are non-linear data structures that require specialized traversal algorithms like Depth First Search (DFS) or Breadth First Search (BFS).
Linear search is strictly a linear data structure algorithm (used on arrays or linked lists).
Step 3: Final Answer:
Therefore, linear search is the most appropriate and best-suited method for an unsorted list, which corresponds to option (B).
Was this answer helpful?
0


Questions Asked in CUET (UG) exam