Re:Binary search with confidence
by mark-r on Monday March 07, 2022 @11:20AM
(#30589623)
Using half-open intervals for std::lower_bound and std::upper_bound has an unexpected benefit. It allows the functions to return an insertion point that keeps the sequence sorted, even if that insertion point is at the end of the sequence.
[ Parent
| on HN ]
There are no comments on this comment yet.