153. Find Minimum in Rotated Sorted Array

Posted 阿怪123

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了153. Find Minimum in Rotated Sorted Array相关的知识,希望对你有一定的参考价值。

public class Solution {
    public int findMin(int[] nums) {
        int len=nums.length;
        for(int i=0;i<len;i++)
        {
            if(i-1>=0)
            {
                if(nums[i]<nums[i-1])
                    return nums[i];
            }
        }
        return nums[0];
    }
}

 

以上是关于153. Find Minimum in Rotated Sorted Array的主要内容,如果未能解决你的问题,请参考以下文章

153. Find Minimum in Rotated Sorted Array

#Leetcode# 153. Find Minimum in Rotated Sorted Array

153. Find Minimum in Rotated Sorted Array

153. Find Minimum in Rotated Sorted Array

153 Find Minimum in Rotated Sorted Array

153. Find Minimum in Rotated Sorted Array