Algorithms and Data Structures · Middle · Question 15 of 75
What does "binary search on the answer" mean?
- 1Running binary search on an array of answers from users
- 2Checking each possible answer from 1 to n until one fits
- ✓Correct answer: Searching for the smallest value meeting a monotonic test
Explanation
If "can we do it with x?" is false up to some point and true after it, you can binary search x. Example: the minimum ship capacity to deliver packages in D days, where each check is a greedy O(n) pass.