Concepts3
⚙️AlgorithmIntermediate
When to Use Binary Search on Answer
Binary search on answer applies when the feasibility of a candidate value is monotonic: if a value works, then all larger (or smaller) values also work.
#binary search on answer#parametric search#monotone predicate+12
⚙️AlgorithmAdvanced
Parallel Binary Search
Parallel Binary Search (PBS) lets you binary-search the answers of many queries at once by batching them by their current mid value.
#parallel binary search#offline queries#monotone predicate+10
⚙️AlgorithmIntermediate
Binary Search
Binary search quickly finds targets or boundaries in sorted or monotonic data by halving the search interval each step.
#binary search#lower_bound#upper_bound+11