Home »
MCQs »
Data Structure and Algorithms (DSA) MCQs
Which of the following correctly defines the worst-case time complexity of Linear Search Algorithm?
3. Which of the following correctly defines the worst-case time complexity of Linear Search Algorithm?
- O(n)
- O(1)
- O(nlogn)
- O(n2)
Answer
The correct answer is: A) O(n)
Explanation
Linear Search, searches an element sequentially in a list. In the worst case, where an element is not present, the linear search algorithm has to scan all elements leading to O(n).