The time complexity of binary search is _______ due to its divide-and-conquer approach.
- O(1)
- O(log n)
- O(n)
- O(n^2)
The time complexity of binary search is O(log n) due to its divide-and-conquer approach. This is because with each comparison, the search space is effectively halved.
Loading...
Related Quiz
- What is the primary objective of the A* search algorithm?
- How does merge sort divide and conquer a given list/array?
- An array is a _______ structure that stores a collection of _______ elements.
- What is the primary goal of solving the Longest Palindromic Substring problem?
- When considering string compression, it's essential to balance _______ with _______.