Advertisement
limimage

binsearch

Sep 11th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.13 KB | None | 0 0
  1. while (l <= r)
  2. {
  3. mid = (l + r) >> 1;
  4. if (check(mid))
  5. l = mid + 1;
  6. else
  7. ans = mid, r = mid - 1;
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement