会员
周边
众包
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
Layton
bb is cheap,show me the code
博客园
首页
新随笔
联系
订阅
管理
2019年9月23日
二分查找&&二分中位数
摘要: 普通二分查找 1 int bs(int L,int R,int x) 2 {//在l到r区间上查找x,找不到就返回-1 3 int l=L,r=R; 4 while(l<=r){ 5 int m=l+r>>1; 6 if(a[m]==x){ 7 return m; 8 } 9 else if(a[m
阅读全文
posted @ 2019-09-23 14:42 艾尔夏尔-Layton
阅读(806)
评论(0)
推荐(0)
编辑
公告