public class Jb19_ArrSearch { public static void main(String[] args) { int[] arr = {0,1,2,3,4,5,6,7,8,9}; int index = binarySearch_2(arr,7); System.out.println(index); } /*数组查找功能 public static int getIndex(int[] arr,int key) { for (int x=0;xarr[mid]) min = mid + 1; else if (key>1; //右移一位相当于除以2的一次幂 if(key>arr[mid]) min = mid + 1; else if(key