Skip to content

Glossary: Data Structures and Algorithms in JavaScript

Lower bound

Also written: lowerBound

A reusable binary search, `lowerBound(items, x)`, that returns the index where `x` would go to keep a sorted array sorted, or the index of its first copy if it is already there. It is O(log n) and suits lookups such as choosing a shipping tier by weight.

Where the book teaches it

Related terms

Binary searchInvariant