Skip to content

Glossary: Data Structures and Algorithms

bisect

Also written: bisect module, bisect_left, bisect_right

A Python module with tested binary searches. `bisect_left(items, x)` returns the index where x would go in the sorted list (the first copy if present), and `bisect_right` returns the index after any copies.

Where the book teaches it

Related terms

Binary search