Overview
Lower Bound is a binary-search variant that keeps the leftmost position whose value is greater than or equal to the target.
Finds the first sorted position where a value could be inserted without breaking order.
Compact metadata for implementation and discovery.
Lower Bound is a binary-search variant that keeps the leftmost position whose value is greater than or equal to the target.
Quick facts
Runtime and memory behavior at a glance.
Best
O(1)
Average
O(log n)
Worst
O(log n)
Space
O(1)
mid = low + floor((high - low) / 2)Chooses the middle of the active half-open interval.
Show the insertion boundary moving left until the first valid position remains.
Lower Bound returns the array length when every value is less than the target.
What each reference supports for this entry.
Sorting and searching reference supporting Lower Bound probe strategy, comparison structure, or implementation invariant.
Algorithms textbook support for Lower Bound invariants, search ordering, correctness argument, or asymptotic analysis.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Lower bound adapts binary search to return the first position where a monotone condition holds.