Concepts4
βοΈ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
βοΈAlgorithmIntermediate
Fix One Variable Technique
The Fix One Variable technique reduces multi-variable search problems by enumerating one variable explicitly and optimizing over the others with structure.
#fix one variable#dimension reduction#two pointers+12
βοΈAlgorithmAdvanced
Aliens Trick (WQS Binary Search)
Aliens Trick (WQS Binary Search) converts a hard βexactly k itemsβ optimization into an unconstrained problem by adding a penalty Ξ» per chosen item.
#aliens trick#wqs binary search#parametric search+11
βοΈAlgorithmIntermediate
Binary Search on Answer
Binary Search on Answer turns an optimization problem into a yes/no decision problem over a monotonic answer space.
#binary search on answer#parametric search#monotonic predicate+12