5 ms·
I believe half-open intervals is something C++ uses for std::lower_bound and std::upper_bound.
by cleancoder0 5y ago
I believe half-open intervals is something C++ uses for std::lower_bound and std::upper_bound.
- thaumasiotes 5y agoHalf-open intervals are very common because they overlap perfectly.
- mark-r 5y agoUsing 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.