publicstaticintbinarySearch(int array[], int number, int value){ int left = 0; int right = number - 1; while (left <= right) { int middle = left + ((right - left) >> 1); if (array[middle] > value) { right = middle - 1; } elseif (array[middle] < value) { left = middle + 1; } else { return middle; } } return -1; } }