Algorithms and Data Structures · Middle · Question 15 of 75

What does "binary search on the answer" mean?

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.

Further reading

Problem with a question

Algorithms and Data Structures · Middle · question 15

Test yourself

Take the Algorithms and Data Structures · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz