Binary Search

Problems on binary search, including finding a value or its first and last position in a sorted array, binary search on the answer, cutting and distributing resources into equal parts, finding roots of monotone functions and searching on real numbers.

The binary search article in the Basics section explains the technique. Related problem sets are under Ternary search, Sorting and Two pointers.

Problems