摘要: 1 调用 int[] arr=new int[] {1,2,3,4,5,6,7,8,9,10}; int index= binarySearch(arr, 8); System.out.println("查找的值8位于数组中的索引为:"+index); 默认传入的数组是排好序的 阅读全文
posted @ 2019-05-03 19:09 白羽轻飘 阅读(653) 评论(0) 推荐(0) 编辑
摘要: int[] arr= {6, 1, 2 ,7 ,9 ,3 ,4 ,5, 10 ,8}; int[] sortArr=Sort(arr,0,arr.length-1); 阅读全文
posted @ 2019-05-03 18:12 白羽轻飘 阅读(218) 评论(0) 推荐(0) 编辑