Which of the following searching algorithms has the best time complexity in…
2025
Which of the following searching algorithms has the best time complexity in the worst case for an unsorted array ?
- A.
Binary Search
- B.
Linear Search
- C.
Jump Search
- D.
Exponential Search
Attempted by 69 students.
Show answer & explanation
Correct answer: B
For an unsorted array, the only reliable method to find a specific element is Linear Search. This algorithm checks each element sequentially from the beginning until the target is found or the array ends. In the worst-case scenario, where the element is at the very end or not present, Linear Search examines every single item, resulting in a time complexity of O(n). Other options like Binary Search, Jump Search, and Exponential Search all require the array to be sorted beforehand to function correctly. Since the question specifies an unsorted array, these algorithms cannot be applied directly without first sorting the data, which would add significant overhead. Therefore, Linear Search is the most appropriate choice with O(n) complexity for this specific constraint.