正在加载图片...
Java.uti i套件 copy ofRange0方法 int[]ayr1={1,2,3,4,5}; int[] arr2 Arrays copyof(arrl, 1,4)i binary Search0方法 int[]arr1={10,20,30,40,50,60,70,80,90}; int result Arrays binarySearch(arrl, 6, 9,85) if(result 1){ System.out. printf("索引器d处找到数据鹗n", result); else System.out. printf("插人点号d影n",(resu1t+1java.util套件 • copyOfRange()方法 • binarySearch()方法 int[] arr1 = {1, 2, 3, 4, 5}; int[] arr2 = Arrays.copyOf(arr1, 1, 4); int[] arr1 = {10, 20, 30, 40, 50, 60, 70, 80, 90}; int result = Arrays.binarySearch(arr1, 6, 9, 85); if(result > -1) { System.out.printf("索引%d处找到数据%n", result); } else { System.out.printf("插入点%d %n", (result + 1) * -1); }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有