When implementing binary search, the choice between using l <= r vs. l < r, and how to update l and r (l = mid + 1 vs. l = mid, etc.), depends on the specific problem and whether you are looking for an exact match, the lower bound, or the upper bound...
Markdown supported · ⌘↵ to post
No responses yet.