Lower Bound

Find the first element greater than or equal to target.

Lower bound: First position where target could insert while keeping sorted. Index of first \geq target.

Examples in [1,3,5,5,7,9][1,3,5,5,7,9]:

  • Lower bound of 55: index 22
  • Lower bound of 66: index 44
  • Lower bound of 1010: index 66 (past end)

Uses: First occurrence, count elements << value, insert position.

More versatile than exact match. Check if lower bound equals target for exact match.