What is the time complexity of binary search?
-
A
O(1)
-
B
O(n)
-
C
O(log n)
Correct answer
-
D
O(n²)
Correct answer
C. O(log n)
15 views
Explanation
Binary search has O(log n) time complexity.
Doubts & discussion
Not sure why the answer is C? Ask here and get an explanation.
Ask a doubt about this MCQ