![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
erfenchazhao
sakurahzy
这个作者很懒,什么都没留下…
展开
-
二分查找
二分法难点:数据索引的更新/* The isBadVersion API is defined in the parent class VersionControl. boolean isBadVersion(int version); */public class Solution extends VersionControl { public int firstB...原创 2018-11-21 15:42:23 · 118 阅读 · 0 评论 -
二分查找
针对排序的数组或者数字,折半查找,时间复杂度O(ologn)计算中值:mid=L+(H-L)/2class Solution { public int mySqrt(int x) { if(x<=1){ return x; } int l=1; int h=x; ...原创 2018-11-20 12:07:43 · 127 阅读 · 0 评论