What is the best case time complexity for binary search?
A. O(n)
B. O(log n)
C. O(n log n)
D. O(1)
Answer: Option D
Solution (By Examveda Team)
Binary search is an efficient algorithm to find an element in a sorted array by repeatedly dividing the search interval in half.The best case time complexity occurs when the target element is found at the very first comparison, which is at the middle of the array.
In this best case scenario, the element is located immediately, so only one comparison is needed.
Therefore, the best case time complexity of binary search is O(1), which means constant time.
Other cases:
- The average and worst case time complexities of binary search are O(log n), where n is the number of elements in the array.
Hence, the correct answer is Option D: O(1).
Join The Discussion
Comments (1)
Related Questions on Introduction to Data Structures
A. A collection of data values
B. A programming language
C. A set of algorithms
D. A way of organizing and storing data

wrong answer
The best case time complexity for binary search is:
O(1)
Binary search works by repeatedly dividing a sorted array in half to find the target value. In the best case, the target element happens to be exactly at the middle index of the array on the first comparison. This means the element is found immediately, requiring only one operation, which is constant time — hence O(1).