您当前的位置: 首页 > 

寻找旋转排序数组中的最小值I/II

对方正在debug 发布时间:2020-03-05 12:30:40 ,浏览量:14

题目:https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array/

class Solution {
public:
    int findMin(vector& nums) {
        /*假设按照升序排序的数组在预先未知的某个点
        *上进行了旋转请找出其中最小的元素。
        *假设数组中不存在重复元素
        */
        int n = nums.size();
        int l = 0,r = n-1;
        int mn = nums[0];
        while(l             
关注
打赏
1688896170
查看更多评论
0.3803s