# LeetCode刷题日记 -704 二分查找
class Solution {
public int search(int[] nums, int target) {
int high,low = 0;
// 排序倒数
high = nums.length-1;
while (low<=high) {
int temp = (high+low)/2;
if(target == nums[temp]) {
return temp;
}
else if(target > nums[temp]) {
low = temp + 1;
}else
原创
2021-11-26 15:24:38 ·
246 阅读 ·
0 评论