Hello everyone, my name is XXX. I'm a college student majoring in English. Recently, I have passed the College English Test Band 4 (CET4). It was a great experience for me to take this exam and I'm proud of myself for passing it.
CET4 is an important test for college students in China to evaluate ...
public class BinarySearch {
public static int binarySearch(int[] arr, int target){
int left = 0;
int right = arr.length - 1;
while(left <= right){
int mid = (left + right) / 2; //取中间值
if(arr[mid] == target){ //如果中间值等于目标值,则返回此下标位置
r...