Question DSA-SRCH-0004
EasyWhat is the best-case time complexity of binary search?
- A.
O(n log n)
- B.
O(n)
- C.
Show answer and explanation
Answer: C
If the middle element is the target, it is found with one comparison.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Searching and Binary Search question
What is the best-case time complexity of binary search?
O(n log n)
O(n)
Answer: C
If the middle element is the target, it is found with one comparison.
O(1)
O(log n)