Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int binarySearchIndexOfMinGreaterElement(double[] list, double value) {
- int left = -1;
- int right = list.length;
- int middle;
- while (left < right - 1) {
- middle = (right + left) / 2;
- if (list[middle] < value) {
- left = middle;
- } else {
- right = middle;
- }
- }
- return right;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement