Binary search and ternary search algorithms
Find the last element < target in a sorted array using binary search.
Find the max or min of a unimodal function on a continuous interval in O(log(range/eps)).
Find the first element >= target in a sorted array using binary search.
Classic binary search for finding a target value in a sorted array in O(log n).
Search for the optimal value satisfying a monotonic predicate in O(log n).