二分查找(非遞歸算法和遞歸算法)

非遞歸算法: package mytest; public class test { public static int BinarySearch(int low,int high,int[]arr,int x){ int loc=-1; while(low<=high){ int mid=(low+high)/2; if(x==arr[mid]){loc=mid;brea
相關文章
相關標籤/搜索