文章目录 一、代码实现 二、测试用例 三、运行结果 一、代码实现 public static int binarySearch(int[] array,int key) { int left=0; int right=array.length-1