会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
10525blogs
博客园
首页
新随笔
联系
订阅
管理
2022年11月1日
二分查找
摘要: 二分查找(折半查找) 前提:排好顺序的数据 //元素存在 返回索引,否则返回-1 public static int binarySearch(int[] arr, int data) { int left = 0; int right = arr.length - 1; while(left <=
阅读全文
posted @ 2022-11-01 10:20 都是废话说了
阅读(16)
评论(0)
推荐(0)
公告