您当前的位置: 首页 > 

对方正在debug

暂无认证

  • 11浏览

    0关注

    399博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

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

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

题目: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             
关注
打赏
1664895754
查看更多评论
0.0369s