Skip to content

Glossary: Coding Interviews in C++

Binary search

Also written: std::lower_bound

Finding something in sorted data by repeatedly checking the middle and discarding half. It costs O(log n), and also solves "first day that reaches a goal" questions.

Where the book teaches it

Related terms

std::lower_boundPattern