二分查找(非递归算法和递归算法)

非递归算法: 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
相关文章
相关标签/搜索