leetcode33.搜索螺旋排序数组——学习笔记
题目:力扣https://leetcode-cn.com/problems/search-in-rotated-sorted-array/
class Solution {
public int search(int[] nums, int target) {
int left = 0;
int right = nums.length-1;
while(left<=right){
int mid = (left+right)/2;
if(target == nums[mid]){
return mid;
}else if(nums[mid]
共有 0 条评论