题目: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
关注
打赏
热门博文