MCQ
Single Best Answer
Easy
QWhat is the time complexity of a linear search algorithm for an unsorted array of n elements in the worst case?
ID: #15245
Time Complexity
160 views
Question Info
#15245Q ID
EasyDifficulty
Time ComplexityTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option C
Explanation
In a linear search algorithm, each element of the array is checked one by one until the target element is found or the end of the array is reached. In the worst case, where the target element is at the last position or absent from the array, the algorithm will need to examine all n elements. Therefore, the time complexity of a linear search is linear, denoted as O(n).
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic