Skip to content

Glossary: Coding Interviews

Binary search

Also written: bisect, bisect_left, bisect.bisect_left

Finding something in sorted data by repeatedly checking the middle and discarding half, which costs O(log n). It also finds the first day that reaches a goal. Python's `bisect.bisect_left` finds a position in a sorted list.

Where the book teaches it

Related terms

Big-O