Skip to content

Glossary: Data Structures and Algorithms in Go

Binary search

Finding an item in sorted data by checking the middle and discarding the half that cannot hold the target. It takes O(log n) steps, at most 20 for a million order IDs.

Where the book teaches it

Related terms

Big-O shapes (O(1), O(log n), O(n), O(n log n), O(n²))Off-by-one errorLinear search