标题:【Code§C/C++】二分查找函数   出处:Felix021 时间:Tue, 28 Aug 2007 22:01:10 +0000 作者:felix021 地址:https://www.felix021.com/blog/read.php?273 内容: 【Code§C/C++】二分查找函数 int find(int R[],int low,int high,int t) { int mid; if(high-low<=1) { if(t==R[high])return high; if(t==R[low])return low; return -1; } mid=(low+high)/2; if(t<=R[mid])return find(R,low,mid,t); else return find(R,mid+1,high,t); } Generated by Bo-blog 2.1.0