摘要: 1 //数组a[]中有n各元素,已经按升序排序,待查找的元素x 2 sort(a,a+n); //升序排序 3 template 4 int BinarySearch(Type a[],const Type&x,int n) 5 { 6 int left=0; //左边界 7 int right=n-1; //右边界 8 while(lefta[middl... 阅读全文
posted @ 2017-04-26 21:07 灬从此以后灬 阅读(721) 评论(0) 推荐(0) 编辑