Question Detail

COS 102 test topic Objective Question

Question

What is the asymptotic worst-case time complexity of the standard linear search algorithm on an unsorted array of size n?
Options
A O(1)
B O(log n)
C O(n)
Correct Answer
D O(n^2)
Correct Answer

Option C is the correct answer.

Detailed Explanation

Linear search inspects every element sequentially until the target is located or the entire array of n elements is traversed.

Hint

No hint available

Question Info