Ternary search
A ternary search algorithm is a technique in computer science for finding the minimum or maximum of a unimodal function. == The function == Assume we are looking for a maximum of f ( x ) {\displaystyle f(x)} and that we know the maximum lies somewhere between A {\displaystyle A} and B {\displaystyle B} .