public static int binarySearch(int[] a, int num){ int low = 0; int high = a.length-1; while(low <= high) { int middle = (low + high)/2; if(num== a[middle]) { return middle; }else if(num
本文共 331 字,大约阅读时间需要 1 分钟。
public static int binarySearch(int[] a, int num){ int low = 0; int high = a.length-1; while(low <= high) { int middle = (low + high)/2; if(num== a[middle]) { return middle; }else if(num
转载于:https://www.cnblogs.com/lxcmyf/p/7220908.html